Prashant T. wrote:
I want to insert onto database the Current DateTime Value into database
field “Store_date” with datatype (DATETIME). How to do tihs?
I am usiing hidden variable into my form as follows:-
<%= hidden_field(“store”, “store_date”, :value =>:datetime ) %>
But when I m submmittng form I couldn’t find entry in store_date field.
How to do this using hidden variable?
Please help me.
Prashant, please look at the documentation regarding created_on and
updated_on. There’ is no need to use a hidden field for thuis as rails
will automatically update certion fields for you.
See, for example,
As regards the hidden field, a quick google for “ruby on rails
hiden_field documentation” returned this:
It looks like you’re attempting to specify the data type (:datetime) in
the value field. Is that correct ?