# Variable dumper

**URL:** <https://www.ruby-forum.com/t/variable-dumper/51024>\
**Category:** Rails\
**Created:** [December 24, 2005, 2:03am UTC](https://www.ruby-forum.com/t/variable-dumper/51024 "2005-12-24T02:03:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ezran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b9bd4f/32.png) [@ezran](https://www.ruby-forum.com/u/ezran)\
**Post date:** [December 24, 2005, 2:03am UTC](https://www.ruby-forum.com/t/variable-dumper/51024/1 "2005-12-24T02:03:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ezran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b9bd4f/32.png) [@ezran](https://www.ruby-forum.com/u/ezran)\
**Post date:** [December 24, 2005, 3:37am UTC](https://www.ruby-forum.com/t/variable-dumper/51024/2 "2005-12-24T03:37:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ezran](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b9bd4f/32.png) [@ezran](https://www.ruby-forum.com/u/ezran)\
**Post date:** [December 24, 2005, 9:58am UTC](https://www.ruby-forum.com/t/variable-dumper/51024/3 "2005-12-24T09:58:24Z")

</div>

> 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…).
