# How to display a method's "Ruby Stack Path"

**URL:** <https://discuss.rubyonrails.org/t/how-to-display-a-methods-ruby-stack-path/26400>\
**Category:** rubyonrails-talk\
**Created:** [March 17, 2008, 2:35am UTC](https://discuss.rubyonrails.org/t/how-to-display-a-methods-ruby-stack-path/26400 "2008-03-17T02:35:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruby\_Freak](https://avatars.discourse-cdn.com/v4/letter/r/b782af/32.png) [@Ruby\_Freak](https://discuss.rubyonrails.org/u/Ruby_Freak)\
**Post date:** [March 17, 2008, 2:35am UTC](https://discuss.rubyonrails.org/t/how-to-display-a-methods-ruby-stack-path/26400/1 "2008-03-17T02:35:50Z")

</div>

I am trying to learn the Ruby behind Rails and it would be helpful to be able to find the Ruby code for a given method. For example I am in Script/console and I do: "puts ActiveRecord.methods". I get a nice list. Lets say I want to explore the mattr\_accessor method. Is there a command or method that would give me the Stack Trace to that piece of Ruby code? I am using Windows Grep to find it now and that doesn't usually work as many of the methods are added via class\_eval from somewhere far far away.

it turns up in: C:\ruby\lib\ruby\gems\1.8\gems\activesupport-2.0.2\lib\active\_support \core\_ext\module\attribute\_accessors.rb

Typing in some Ruby Magic like ActiveRecord.mattr\_accessor.ruby\_path would be really cool. But, I suppose the methods added by "included" callbacks are going to be invisible... Tell me it isn't so!

Thanks in advance
