Benjamin
Benjamin

Reputation: 561

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 another page while the test is running. Thanks.

Upvotes: 0

Views: 51

Answers (1)

apneadiving
apneadiving

Reputation: 115531

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.

Upvotes: 3

Related Questions