That is why I mentioned it was a hack..

I take it there is no way to do it via the to_json method which is the
view at this point?

Thanks..
-tim

On Aug 19, 3:46 pm, Robert Walker <[email protected]>
wrote:
> 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 viahttp://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
-~----------~----~----~----~------~----~------~--~---

Reply via email to