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


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to