I am using jquery ui datepicker in my app in a form. when I save the form the date field in shown nil.
I have installed "jquery-ui-rails" gem and given require jquery ui.all in application.js and application.css
My code goes as follows in view
<div>
<%= f.label :deadline %>
<%= f.text_field :deadline, :id => "datepicker" %>
</div>
In application.js
$(function() {
$( "#datepicker" ).datepicker({
minDate: 0
});
});
On submitting the form
Parameters: {"utf8"=>"✓","authenticity_token"=>"aoiDOLAGZHKui85hum7ozJ31QNZopOvmImyOuDyXCw4=", "task"=>{"task"=>"task1", "assigned_to_id"=>"2", "deadline"=>"10/30/2013", "project"=>"", "workspace_id"=>"4"}, "commit"=>"Create", "id"=>"4"}
Insert Into:
INSERT INTO "tasks" ("assigned_to_id", "created_at", "project", "task", "updated_at", "user_id", "workspace_id") VALUES (?, ?, ?, ?, ?, ?, ?) [["assigned_to_id", 2], ["created_at", Mon, 28 Oct 2013 09:51:22 UTC +00:00], ["project", ""], ["task", "task1"], ["updated_at", Mon, 28 Oct 2013 09:51:22 UTC +00:00], ["user_id", 1], ["workspace_id", 4]]
Here deadline field is not present. It is shown as nil.I have checked the schema for spell check too... everything is correct. What might be the reason and how to rectify this. Pls help me out of this.