I have a form where the date has to be selected and it has to be passed to an action. But it is not passing as params to that action. I am using jquery datepicker for selecting dates.
View page
<%=f.text_field :due_date%>
Controller page
def create
@task = Task.new(params[:task])
if @task.valid?
@task.due_date=params[:task][:due_date]
@task.save
redirect_to(calenders_path(:date=>@task.due_date,:task_name=>params[:task][:task_name]))
else
render :action=>"new"
end
end
Here only :task_name is passing as params
Please help
Try this:
The
due_dateparam should already be populated by the first line. You might be setting it to null with@task.due_date=params[:task][:due_date].