I have a ''user'' folder and an ''appname'' folder. When a user signs up, i want to call an action to send them to the ''list'' page, which is in ''appname''. However i can''t work out how to call an action in a different controller/view in a different view folder (incidentally, which is called - the controller action or the view page?). I''ve been trying stuff like redirect_to :action => "AppnameController.list" redirect_to :action => "../appname/list" etc... Can anyone help please? This feels like it''s simple but i just don''t know the syntax. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Shai Rosenfeld
2007-Jul-19 13:40 UTC
Re: noob question: calling a view in a different folder
Max Williams wrote:> I have a ''user'' folder and an ''appname'' folder. When a user signs up, i > want to call an action to send them to the ''list'' page, which is in > ''appname''. However i can''t work out how to call an action in a > different controller/view in a different view folder (incidentally, > which is called - the controller action or the view page?). > > I''ve been trying stuff like > > redirect_to :action => "AppnameController.list" > redirect_to :action => "../appname/list" > > etc... > > Can anyone help please? This feels like it''s simple but i just don''t > know the syntax.you might be looking at redirect_to :controller => ''appname'', :action => ''list'' (if the ''list'' action is in the appname; redirects there no matter what controller you are in) render :template => ''appname/list'' (if you want to render the template, you can do this in the controller or the view. the path is relative to the app/view directories) hth -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Max Williams
2007-Jul-19 13:41 UTC
Re: noob question: calling a view in a different folder
Shai Rosenfeld wrote:> Max Williams wrote: >> I have a ''user'' folder and an ''appname'' folder. When a user signs up, i >> want to call an action to send them to the ''list'' page, which is in >> ''appname''. However i can''t work out how to call an action in a >> different controller/view in a different view folder (incidentally, >> which is called - the controller action or the view page?). >> >> I''ve been trying stuff like >> >> redirect_to :action => "AppnameController.list" >> redirect_to :action => "../appname/list" >> >> etc... >> >> Can anyone help please? This feels like it''s simple but i just don''t >> know the syntax. > > you might be looking at > > redirect_to :controller => ''appname'', :action => ''list'' > (if the ''list'' action is in the appname; redirects there no matter what > controller you are in) > > render :template => ''appname/list'' > (if you want to render the template, you can do this in the controller > or the view. the path is relative to the app/view directories) > > hthNever mind, i found the answer! I need to pass the controller as well - redirect_to :controller => "appname", :action => "list" Thanks anyway! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Max Williams
2007-Jul-19 13:42 UTC
Re: noob question: calling a view in a different folder
> > you might be looking at > > redirect_to :controller => ''appname'', :action => ''list'' > (if the ''list'' action is in the appname; redirects there no matter what > controller you are in) > > render :template => ''appname/list'' > (if you want to render the template, you can do this in the controller > or the view. the path is relative to the app/view directories) > > hthAh, that second bit''s useful as well. Thanks a lot! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---