Rails datetime_local_field help not pre filling -


i have job model first_booking_time attribute. datetime_local_field form helper doesn't pre fill attribute stored on job instance.

# renders empty field though job.first_booking_time set <%= form_for @job |f| %>   <%= f.datetime_local_field :first_booking_time %> <% end %> 

however, if use datetime_local_field_tag helper , pass in value, works:

# pre fills what's in job.first_booking_time <%= form_for @job |f| %>       <%= datetime_local_field_tag 'job[first_booking_time]', @job.first_booking_time %> <% end %> 

how can use first syntax helper pre filling?

try below code

<%= f.datetime_local_field :first_booking_time , :value => @job.first_booking_time %> 

Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -