My form is passing dates in the format “2 Apr 2012”
I understand I can format the individual params using something like this:
@release_date = Date.parse(params[:release_date]).strftime("%Y-%m-%d")
@original_release_date = Date.parse(params[:original_release_date]).strftime("%Y-%m-%d")
@preorder_start_date = Date.parse(params[:preorder_start_date]).strftime("%Y-%m-%d")
But how do I then pass the formatted values to my create action?
@product = @release.products.create(params[:product])
Thanks in advance!
If you have same field into the database then overwrite the value of params like :