Forum: Ruby on Rails Variable dumper

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ezra N. (Guest)
on 2005-12-24 03:03
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
Ezra Z. (Guest)
on 2005-12-24 04:37
(Received via mailing list)
On Dec 23, 2005, at 5:03 PM, Ezra Nugroho wrote:

> 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 Z.
WebMaster
Yakima Herald-Republic Newspaper
removed_email_address@domain.invalid
509-577-7732
Ezra N. (Guest)
on 2005-12-24 10:58
> 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 Z.

Thanks Ezra! I know someone in this list is better than Ezra (this one
is me of course..).
This topic is locked and can not be replied to.