# List controller actions

**URL:** <https://www.ruby-forum.com/t/list-controller-actions/188889>\
**Category:** Rails\
**Created:** [May 19, 2010, 10:37pm UTC](https://www.ruby-forum.com/t/list-controller-actions/188889 "2010-05-19T22:37:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [May 19, 2010, 10:37pm UTC](https://www.ruby-forum.com/t/list-controller-actions/188889/1 "2010-05-19T22:37:05Z")

</div>

Is there a way to list on a web page the current controller actions  
define din the controller? Would like to put up a link for each  
automatically.

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [May 19, 2010, 10:56pm UTC](https://www.ruby-forum.com/t/list-controller-actions/188889/2 "2010-05-19T22:56:59Z")

</div>

On May 19, 2010, at 1:35 PM, Me wrote:

> Is there a way to list on a web page the current controller actions  
> define din the controller? Would like to put up a link for each  
> automatically.

> > PagesController.instance\_methods(false)  
> > =\> [“destroy”, “contact”, “list”, “show”, “expire\_all”, “edit”,  
> > “method\_missing”]
> 
> >

You may need to edit down the list just a bit, as you can see. I  
implemented a few methods in this class (like method\_missing) that  
should be actions that might not be appropriate in a list.

Good luck.

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [May 19, 2010, 11:03pm UTC](https://www.ruby-forum.com/t/list-controller-actions/188889/3 "2010-05-19T23:03:25Z")

</div>

Cool forgot about the (false). Any way to get the respond\_to formats  
also

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [May 19, 2010, 11:50pm UTC](https://www.ruby-forum.com/t/list-controller-actions/188889/4 "2010-05-19T23:50:51Z")

</div>

On May 19, 2010, at 2:01 PM, Chris H. wrote:

> > > PagesController.instance\_methods(false)  
> > > =\> [“destroy”, “contact”, “list”, “show”, “expire\_all”, “edit”, “method\_missing”]
> > 
> > >
> 
> You may need to edit down the list just a bit, as you can see. I implemented a few methods in this class (like method\_missing) that should be actions that might not be appropriate in a list.
> 
> Good luck.

Not sure what the respond\_to formats are. Are you referring to whether  
Rails renders a particular format like XML, etc.?

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [May 19, 2010, 11:53pm UTC](https://www.ruby-forum.com/t/list-controller-actions/188889/5 "2010-05-19T23:53:46Z")

</div>

ya we have you know action.format set up, I was trying to auto set up  
links  
for each type.
