Hello All,
My problem is i have field "expiry_date" which is a "date" type. I want to take that date and store it in database as following
in controller
Hello All,
My problem is i have field "expiry_date" which is a "date" type. I want to take that date and store it in database as following
in controller
why not let activerecord do the hard work for you ? Anywway, the problem here is that you need to turn those strings into integers before giving them to Date.civil.
Fred
Let active record do the work for you. Put in a before_validation_on_create (or update or whatever) hook in your model and do the changes you want. Also, isn't Date.civil the same as the normal date convention we use?