Formatting Dates in Rails 3.0
- by Neil Middleton
I'm trying to format a date in Rails 3 using the new syntax as described in the code:
http://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/date/conversions.rb
by using the following syntax in an initialiser:
Date::DATE_FORMATS[:my_format] = '%m %d %Y'
I am then referencing dates in my view like so:
comment.created_at.to_formatted_s(:my_format)
However, I'm just getting the default formatting - what could be wrong?