Tim W. wrote:
> I'd like to do it on the server side, but then the only way I can see
> is a complete hack around by adding another method to the ActiveRecord
> class.
>
> def created_at_formatted
> self.created_at.to_S('md')
> end
>
> object.to_json( :methods => [:created_at_formatted] )
Model objects should not be responsible for formatting data for
presentation. This responsibility should be implemented in view objects
(or view helper objects such as formatter objects).
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---