# Help with Custom Rest Actions

**URL:** <https://www.ruby-forum.com/t/help-with-custom-rest-actions/127081>\
**Category:** Rails\
**Created:** [January 24, 2008, 8:19pm UTC](https://www.ruby-forum.com/t/help-with-custom-rest-actions/127081 "2008-01-24T20:19:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [January 24, 2008, 8:19pm UTC](https://www.ruby-forum.com/t/help-with-custom-rest-actions/127081/1 "2008-01-24T20:19:09Z")

</div>

How can I create a method like show and link to it from index?

what should I put in routes.rb?  
what should I put to link to it?

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [January 24, 2008, 11:33pm UTC](https://www.ruby-forum.com/t/help-with-custom-rest-actions/127081/2 "2008-01-24T23:33:20Z")

</div>

why do you want to link to it from index? do you mean an actual  
“link\_to” hyperlink? or do you mean that you want it to display INSTEAD  
of index?

if the latter, in your routes.rb file put:

map.connect ‘’, :controller =\> ‘site’, :action =\> ‘show’

if your site were at [www.mysite.com](http://www.mysite.com) and your user tried to go there they  
would be redirected to the show action of the site controller…
