Allowing a user to manually run a scheduled program from rails
As part of my web application I have a program that runs periodically during low activity times. However I want to allow the functionality to the user to be able to start the program manually. How can I do this? Where should I put my ruby program within the rails framework and how do I offer a link to commence the program then redirect to ano开发者_如何转开发ther page while the test is running. Thanks.
The code could be put in any controller but if you want the program to run quietly behind the scene without blocking your browser (pretty logic spec), you should trigger it using some tool like DelayedJob
or Resque
.
Great Railscasts here.
精彩评论