Ok, works perfectly in the page, but how do I get it to insert the value
into the db. I simply replaced the existing
<%= date_select ‘timelog’, ‘worked_on’, :class => ‘field’ %>
but I get an error thrown indicating “Mysql::Error: Column ‘worked_on’
cannot be null”
These are the request parameters:
Parameters: {“commit”=>“Create”, “task”=>{“percent_complete”=>“90”,
“id”=>“9”}, “timelog”=>{“task_id”=>“0”, “hours”=>“1”,
“comment”=>“test”}, “worked_on”=>“2006-4-26”}
So the date is there. What’s happening??
Then another question - how do I display today’s date on the page (i’ll
put that instead of the [ choose date ] link.
thx
n.
Craig W. wrote:
On Fri, 2006-04-28 at 14:57 +0200, Nick C. wrote:
And the field that receives the value is:
But where do I put the following files?
date_picker_helper.rb
app/helpers
date-picker.css
public/stylesheets
date-picker.js
public/javascripts
And where do I reference these? I’m using a std _form.html partial for
new and edit.
the javascript should be referenced in the html header (generally in the
layout file), the helper should be automatic.
duh, the field name should have been timelog[worked_on]. Works perfectly
now.
Just need to display today’s date now?
thx
n.
Nick C. wrote:
Ok, works perfectly in the page, but how do I get it to insert the value
into the db. I simply replaced the existing
<%= date_select ‘timelog’, ‘worked_on’, :class => ‘field’ %>
but I get an error thrown indicating “Mysql::Error: Column ‘worked_on’
cannot be null”
These are the request parameters:
Parameters: {“commit”=>“Create”, “task”=>{“percent_complete”=>“90”,
“id”=>“9”}, “timelog”=>{“task_id”=>“0”, “hours”=>“1”,
“comment”=>“test”}, “worked_on”=>“2006-4-26”}
So the date is there. What’s happening??
Then another question - how do I display today’s date on the page (i’ll
put that instead of the [ choose date ] link.
And in environment.rb, to make the rails displayed date format the same
as the format the date picker uses:
ActiveSupport::CoreExtensions::Conversions::DATE_FORMATS.merge!(
:my_format_1 => ‘%d %b %Y’
)
Thanks Craig.
n.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.