Forum: Ruby on Rails How to specify default action for particulr actioncontroller

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8c70506408fddb9740b4de7339055c77?d=identicon&s=25 Prashant Tiwari (tiwaripk)
on 2006-03-17 08:33
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
Bd3a4af368439803aa37d318f9941a9f?d=identicon&s=25 David (Guest)
on 2006-03-17 09:50
Prashant Tiwari 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.
22580f640e491f0920a192610d1df393?d=identicon&s=25 Tom Davies (Guest)
on 2006-03-17 12:22
(Received via mailing list)
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 Tiwari <tiwari_p_k@yahoo.com> wrote:
>
> Prash
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
Tom Davies

http://blog.atomgiant.com
http://gifthat.com
This topic is locked and can not be replied to.