How to specify default action for particulr actioncontroller

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

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.

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. [email protected] wrote:

Prash


Posted via http://www.ruby-forum.com/.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Tom D.

http://blog.atomgiant.com
http://gifthat.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs