I have a ruby model that contains a date attribute that I would like to pass as a parameter in the format dd / MM / yyyy.
However, my sqlite3 db stores data in the format yyyy-MM-dd, so when a date such as 10/20/2010 is transferred, it will not be read in the database.
I use the Sinatra framework and use haml to create markup.
Do I need to write a helper that takes a date string and converts it to the correct format for db? Or can I set the format type in the models attribute?
Thank.
source
share