Fernando Perez
2010-Jul-26 23:09 UTC
Default rendered error file and hash to nice string how to
Hi, When rails raises an exception which file (view?) gets rendered and outputs in the browser the backtrace, request, parameters, etc. I''m asking that because I''d like to know if Rails provides an easy way to convert a hash to a readable string, eg: "{:key => ''value''}" instead of yukky #to_s which gives "keyvalue". Thanks -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Dave Aronson
2010-Jul-27 15:41 UTC
Re: Default rendered error file and hash to nice string how to
On Mon, Jul 26, 2010 at 19:09, Fernando Perez <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I''d like to know if Rails provides an easy way > to convert a hash to a readable string, eg: > > "{:key => ''value''}" instead of yukky #to_s which gives "keyvalue".Maybe you can override to_s? -Dave -- Specialization is for insects. -RAH | Have Pun, Will Babble! -me Programming Blog: http://codosaur.us | Work: http://davearonson.com Leadership Blog: http://dare2xl.com | Play: http://davearonson.net -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Jul-27 17:50 UTC
Re: Default rendered error file and hash to nice string how
Fernando Perez wrote:> Hi, > > When rails raises an exception which file (view?) gets rendered and > outputs in the browser the backtrace, request, parameters, etc. > > I''m asking that because I''d like to know if Rails provides an easy way > to convert a hash to a readable string, eg: > > "{:key => ''value''}" instead of yukky #to_s which gives "keyvalue".Are you looking for something like p or inspect ?> > > ThanksBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Fernando Perez
2010-Jul-27 20:46 UTC
Re: Default rendered error file and hash to nice string how
> Are you looking for something like p or inspect ?Damn'' it! I completely forgot about Hash#inspect! Thanks Marnen :) -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Fernando Perez
2010-Aug-15 16:16 UTC
Re: Default rendered error file and hash to nice string how
I think I''m experiencing an issue with Hash#inspect: if one of the values holds a file, it seems Ruby keeps it as a file, so I''ll let you guess what may happen if the file is a bit big when I just expect a little string to represent that file... -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Aug-16 16:01 UTC
Re: Default rendered error file and hash to nice string how
Fernando Perez wrote:> I think I''m experiencing an issue with Hash#inspect: if one of the > values holds a file, it seems Ruby keeps it as a file, so I''ll let you > guess what may happen if the file is a bit big when I just expect a > little string to represent that file...So check for File values. What''s the problem? Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.