Homework question, grrr. http://www.catb.org/~esr/faqs/smart-questions.html#idp54052224
Let's say you have a form that vaguely looks like:
<form action="/stupid/" method="POST">
<input type="text" name="schedule" />
</form>
it's POSTing to the StupidController:
class StupidController < ApplicationController
# POST requests for /stupid/ come here
#
def create
# expects something like "5m" or "10d"
s = params[:schedule]
@job_id =
Rufus::Scheduler.singleton.in(s) do
# do the job...
end
end
end
The controller extracts the user-chosen schedule from the form data and then schedules a job.
If that answer goes above your head like the ones at Can I schedule controller methods in rails using rufus-scheduler? then you should really invest time learning to learn instead of asking people to do your work.