I am using Ruby on Rails v3.2.2 and I would like to display a data as-like <day_number> <month_name> <year_number>. That is, I have a datetime database table column and I would like to change its contained values, for example, from 2012-04-27 00:00:00 to 27 april 2012.
How can I make that?
The standard way is use rails localization.
model
controller
view
config/locales/en.yml
In your case the format should be “%d %A %Y”.
The benefit is if you want to change format you can do it in one place for all datetimes which you are using.