ruby on rails - How to make code run every 30 minutes? -


i have code in home controller

  def index     urls = rssstream.select("rss_streams.url").all.map { |v| v[:url] }     rssstream.update_all_feeds(urls)   end 

and want make run code every 30.minutes. how can it?

i've tried through gem 'whenever', nothing happens

this code should not placed in controller. extract own rake task , let 1 executed whenever!


Comments