Forum: Ruby on Rails make a method in a controller do something by console script

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7007cea0aa8f62646493ac4b50ae0641?d=identicon&s=25 klaas debeuf (Guest)
on 2006-02-28 14:22
is there a possibility to automate a method in a controller by a ruby
script ,

i have written a method which is taking rssfeeds from other sites and
puts it to my database , but i want to have this method called each 15
minutes , can you do it by a console script or do i have build a
stand-alone program?
can somebody put me on the correct track?or give me some hints

greets

Klaas
F4405aa9f526aeea20541ca1aa3705e6?d=identicon&s=25 Mathias Stjernström (Guest)
on 2006-02-28 15:52
(Received via mailing list)
Hi.
You could use the runner script to execute your method(s).

For example:

ruby script/runner -e production 'Import.run()'

Where 'Import' is the model and 'run' is the method.

Put it in crontab and you are good to go!

--
Mathias Stjernstrom
This topic is locked and can not be replied to.