Controller Action - Publish Automation

View: New views
2 Messages — Rating Filter:   Alert me  

Controller Action - Publish Automation

by Adam Akhtar-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I am storing the product, tip and post in Rails built in Cache at the
site www.onebeautyproduct.com. Currently I have built a button in the
administration that says "publish today's events" which essentially
deletes and stores todays events.

I have tried using Cron but it doesn't work with cache and it only works
with a Model's methods. Anyone have a recommendation on how to do this?

Thanks a lot!
--
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Controller Action - Publish Automation

by Adam Akhtar-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> I have tried using Cron but it doesn't work with cache and it only works
> with a Model's methods. Anyone have a recommendation on how to do this?
>
Hmm... what type of caching do you use?

I use fragment caching, and each model clears its own cache items
whenever it receives an update of data shown in one type of cache or
another.  The 'show' cache is always invalidated, the other four cached
views depend on whether the data for that view was changed or not.

Shouldn't be difficult to adapt that to a method called when a model
instance is 'deleted and stored', depending on how your caching is
setup.
--
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---