On Sat, Apr 16, 2011 at 9:52 AM, Colin Law <clan...@googlemail.com> wrote: > On 16 April 2011 00:55, Sebastian <sebastianthegreat...@gmail.com> wrote: >> On Fri, Apr 15, 2011 at 5:34 PM, Colin Law <clan...@googlemail.com> wrote: >>> On 15 April 2011 16:19, Colin Law <clan...@googlemail.com> wrote: >>> ... >>> Answering my own question, yes this appears to be a Ruby 1.9 >>> enhancement. If you are using 1.9 then what happens if in the console >>> you do >>> record.created_at.strftime(%H:%M:%S.%L") >>> >> >> irb(main):001:0> News.find(1).created_at.strftime("%H:%M:%S.%L") >> => "22:52:52.758" >> irb(main):002:0> News.find(1).created_at.strftime("%H:%M:%S.%N") >> => "22:52:52.758612000" >> >> %N or %6N seems to return the desired amount of decimals. But since my >> output is in json I need to do something like the below: >> >> format.json { render :json => @news.map! { |n| >> n.created_at.strftime("%Y:%m:%d %H:%M:%S.%6N") } } >> >> But that only returns the created_at attributes. I need the rest of my >> news data as well. > > So is it correct that your problem has now resolved to a json issue? > If so then if you need more help I suggest a new thread. >
Yes, indeed. Thanks for the support, greatly appreciated. -- 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 rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.