How to specify default action for particulr actioncontroller


#1

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


#2

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.


#3

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 wrote:

Prash


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


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


Tom D.

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