your input format is DD/MM/YYYY. change this to MM/DD/YYYY.
On Tue, Jul 12, 2011 at 6:45 AM, Leigh Daniels <[email protected]>wrote:
> Hi All,
>
> When I enter a Start Date in the text field as "07/11/2011" it gets stored
> in the database as "2011-11-07" instead of "2011-07-11".
>
> This change happens before the column is available in the controller. Is
> there some Rails setting that will make this happen magically or do I have
> to have some fun with date parsing?
>
> Thanks!
>
> **Leigh
>
> ---------------------
>
> [_form.html.erb]
> <%= f.label :start_date, :class => 'label' %><br />
> <%= f.text_field :start_date, :size => 15 %>
>
> [jobs_controller.rb]
> def new
> @job = Job.new
> @job.rate = 125
>
> respond_to do |format|
> format.html # new.html.erb
> format.json { render json: @job }
> end
> end
>
> [schema.rb]
> t.date "start_date"
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.