he…
I have an action and in this action I want to call an other action
for example list in controller article…
I now how to do this if the action you want to call is in the same
controller:
def index
list
end
but what if the action is in a other controller?
article/list doesn’t work
hope somebody can help me …
Nice … I also want to know this…
On 01/11/2007, Heldop S. [email protected] wrote:
–
Posted via http://www.ruby-forum.com/.
–
Arun A.
Sent from BlackBerry(R) on Hutch
On 1 Nov 2007, at 18:19, Arun A. wrote:
I now how to do this if the action you want to call is in the same
controller:
def index
list
end
but what if the action is in a other controller?
article/list doesn’t work
You can’t. Why do you want to do this? This probably means that this
code you are trying to call should either be part of one of your
models or in a module you can include in both controllers.
Fred
On 1 Nov 2007, at 19:26, Heldop S. wrote:
I have an action index where I call for example the action article.
for example to do this:
if bla than
article
else
login
end
You should redirect them to the login page if they need to be logged in
Fred
Frederick C. wrote:
On 1 Nov 2007, at 18:19, Arun A. wrote:
I now how to do this if the action you want to call is in the same
controller:
def index
list
end
but what if the action is in a other controller?
article/list doesn’t work
You can’t. Why do you want to do this? This probably means that this
code you are trying to call should either be part of one of your
models or in a module you can include in both controllers.
Fred
I have an action index where I call for example the action article.
for example to do this:
if bla than
article
else
login
end
It would be nise to have that in seperated controllers so that
everything is organised … 
thanxs for the replay
Frederick C. wrote:
On 1 Nov 2007, at 19:26, Heldop S. wrote:
I have an action index where I call for example the action article.
for example to do this:
if bla than
article
else
login
end
You should redirect them to the login page if they need to be logged in
Fred
wel … yes I now…
it was just an example (and not a realy good one ) … here is my
problem:
I have a layout page where a menu and articles are loaded … when you
start the site you are in the action index (in application)… the index
will call the actions menu, articles and login (this is in the footer)
(and more if nessecery).
I have now all the actions in the application but I would like to have
them in other controllers. beceause it is more manageble… but I
understand that is not possible.
You can either put them in a module as has already been mentioned, and
then include them in your controllers, or you can put them in helpers/
application_helper, or you can put them in ApplicationController as
all your other controllers subclass this, meaning they would
automatically inherit them.
On Nov 1, 10:27 pm, Heldop S. [email protected]
Matt Su wrote:
You can either put them in a module as has already been mentioned, and
then include them in your controllers, or you can put them in helpers/
application_helper, or you can put them in ApplicationController as
all your other controllers subclass this, meaning they would
automatically inherit them.
On Nov 1, 10:27 pm, Heldop S. [email protected]
ok… I did that (put almost all of it in the applicationController) … A
shame it isn’t possible to put it in other controller… but wel…
thanxs for the reply’s all …