Hi there, I am newbie both in Ruby and in Rails. My experience is mostly PHP. In PHP, there is a var_dump($mixed) function that dumps the object $mixed to std_out. This is helpful to see the curent value of a variable, of if it is an object, everything that is in the object. Is there an equivalent methods in RoR? Thanks, Ezra -- Posted via http://www.ruby-forum.com/.
On Dec 23, 2005, at 5:03 PM, Ezra Nugroho wrote:> Hi there, > > > I am newbie both in Ruby and in Rails. My experience is mostly PHP. > In PHP, there is a var_dump($mixed) function that dumps the object > $mixed to std_out. This is helpful to see the curent value of a > variable, of if it is an object, everything that is in the object. > > Is there an equivalent methods in RoR? > > Thanks, > Ezra > > -- >Hey Ezra- If you want to get a look at your variables in any of your .rhtml views you can do so like this: <%= debug(@post) %> replace @post with whatever you want to dump. This will pretty print your data so you can see what''s going on. Cheers- -Ezra Zygmuntowicz WebMaster Yakima Herald-Republic Newspaper ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org 509-577-7732
> Hey Ezra- > > If you want to get a look at your variables in any of your .rhtml > views you can do so like this: > > <%= debug(@post) %> > > replace @post with whatever you want to dump. This will pretty print > your data so you can see what''s going on. > > Cheers- > -Ezra ZygmuntowiczThanks Ezra! I know someone in this list is better than Ezra (this one is me of course..). -- Posted via http://www.ruby-forum.com/.