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

**URL:** <https://www.ruby-forum.com/t/how-to-display-a-methods-ruby-stack-path/132107>\
**Category:** Rails\
**Created:** [March 17, 2008, 3:36am UTC](https://www.ruby-forum.com/t/how-to-display-a-methods-ruby-stack-path/132107 "2008-03-17T03:36:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubyfreak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Post date:** [March 17, 2008, 3:36am UTC](https://www.ruby-forum.com/t/how-to-display-a-methods-ruby-stack-path/132107/1 "2008-03-17T03:36:40Z")

</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
