I use the jQuery datepicker widget and the date is formatted in this
format in the input field after picking a date: dd/mm/yy. I have to
format the date for saving to the database and I made an method that
converts the date in my controller. This works fine but my senses are
telling me I have to do that in the model. How I do that? I’m playing
with before_update and before_save, but how does this work with
update_attributes?
Code:
@fund = InvestmentFund.find params[:investment_fund][:id]
params[:investment_fund][:start_date] = format_date_jquery_db
(params[:investment_fund][:start_date])
and then I save with update_attributes