Forum: Ruby on Rails controllers!?

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.
Marc n. (Guest)
on 2007-03-04 18:53
(Received via mailing list)
when i put: render :action=>"list" in my "index" method of my
controller it doesn't use/create the variables created in the list
method it only gives the "list" view? is that supposed to happen
Dave C. (Guest)
on 2007-03-04 18:59
Marc Rice wrote:
> when i put: render :action=>"list" in my "index" method of my
> controller it doesn't use/create the variables created in the list
> method it only gives the "list" view? is that supposed to happen

try

redirect_to :action => "list"

instead.
Chris M. (Guest)
on 2007-03-04 19:12
(Received via mailing list)
On Mar 4, 4:52 pm, "libsfan01" <removed_email_address@domain.invalid> wrote:
> when i put: render :action=>"list" in my "index" method of my
> controller it doesn't use/create the variables created in the list
> method it only gives the "list" view? is that supposed to happen

Yes. Calling render :action => "list" doesn't actually run the method
called 'list'. It just renders the default view template that would
have been used if you have called the action 'list' normally.

Chris
Marc n. (Guest)
on 2007-03-04 19:18
(Received via mailing list)
>
> Yes. Calling render :action => "list" doesn't actually run the method
> called 'list'. It just renders the default view template that would
> have been used if you have called the action 'list' normally.
>
> Chris

So am i right to assume that you can run different actions on the same
layout and the variables referenced in the ERB will inherit whatever
values the 'calling' action gives them?
This topic is locked and can not be replied to.