# How to specify default action for particulr actioncontroller

**URL:** <https://www.ruby-forum.com/t/how-to-specify-default-action-for-particulr-actioncontroller/83081>\
**Category:** Rails\
**Created:** [March 17, 2006, 8:33am UTC](https://www.ruby-forum.com/t/how-to-specify-default-action-for-particulr-actioncontroller/83081 "2006-03-17T08:33:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiwaripk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7ab992/32.png) [@tiwaripk](https://www.ruby-forum.com/u/tiwaripk)\
**Post date:** [March 17, 2006, 8:33am UTC](https://www.ruby-forum.com/t/how-to-specify-default-action-for-particulr-actioncontroller/83081/1 "2006-03-17T08:33:31Z")

</div>

HI,

How to specify default action for particular actioncontroller? Currently  
when I m typing the URL as “http:\localhost:3000\actioncontroller\_name”  
, then I m getting the default actin page as list.rHtml. But instead I  
want my action page to be index.rHtml.

How to do it?

Thanx.

Prash

---

<div class="post-metadata">

**Author:** ![tiwaripk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7ab992/32.png) [@tiwaripk](https://www.ruby-forum.com/u/tiwaripk)\
**Post date:** [March 17, 2006, 9:50am UTC](https://www.ruby-forum.com/t/how-to-specify-default-action-for-particulr-actioncontroller/83081/2 "2006-03-17T09:50:34Z")

</div>

Prashant T. wrote:

> HI,
> 
> How to specify default action for particular actioncontroller? Currently  
> when I m typing the URL as “http:\localhost:3000\actioncontroller\_name”  
> , then I m getting the default actin page as list.rHtml. But instead I  
> want my action page to be index.rHtml.

If you built your controller using scaffolding, it will automatically  
have an ‘index’ that uses the list method.

Open up the controller and remove the following lines from ‘index’:

```
list
render :action => 'list'

```

You can now use the view index.rhtml. Hope that helps.

---

<div class="post-metadata">

**Author:** ![tiwaripk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7ab992/32.png) [@tiwaripk](https://www.ruby-forum.com/u/tiwaripk)\
**Post date:** [March 17, 2006, 12:22pm UTC](https://www.ruby-forum.com/t/how-to-specify-default-action-for-particulr-actioncontroller/83081/3 "2006-03-17T12:22:15Z")

</div>

The index action is the default action. Did you generate your action  
using scaffolding? If so, I believe the index redirects to the list  
action.

Another place to check is in your config/routes.rb.

Tom

On 3/17/06, Prashant T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Prash
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
Tom D.

[http://blog.atomgiant.com](http://blog.atomgiant.com)  
[http://gifthat.com](http://gifthat.com)
