i once used something like to_s(:mydate) but it never worked so i always go for the sure thing.
can you show the stack for both errors? On Sat, Sep 11, 2010 at 3:37 PM, Andreas Schmidt <[email protected]>wrote: > Hello radhmes brito, > > as you can see here: > http://api.rubyonrails.org/classes/ActiveSupport/TimeWithZone.html > it is possible to output a formatted like i tried. You can simply set > it up in /config/initializeres/time_formats.rb like this: > Time::DATE_FORMATS.merge!( > :mydate => '%d.%m.%Y' > ) > > Then you should be able to call to_s(:mydate) on and > ActiveSupport::TimeWitzZone Object. That works fine in the console, > but not in the view. > > So you mentioned strftime to format the time. I tried that also ;-) > The only thing that changes then ist the error message: > > undefined method `strftime' for nil:NilClass > > But how can this be a NilClass? The attribute is set in the database, > i checked that already via hand and if i ask the object for its class, > it gives me ActiveSupport::TimeWithZone back. > > -- > 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]<rubyonrails-talk%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- 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.

