By default, Rails associates an action with a template having the
same name as the name of the action and residing in a directory with
the same name as the name of the controller.
Is there some way from within the action that I can change this
behavior? I''m thinking that I could probably change it from within
routes.rb; but, I''d really rather do it from within the action so that
when I look at the action code I can clearly see what I did rather
than spending time scratching my head and wondering why my action is
displaying a non-default template.
Thanks for any input.
... doug
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
sure: render :template => ''path/to/template'' The path is rooted in /app/views. -Bill doug wrote:> By default, Rails associates an action with a template having the > same name as the name of the action and residing in a directory with > the same name as the name of the controller. > > Is there some way from within the action that I can change this > behavior? I''m thinking that I could probably change it from within > routes.rb; but, I''d really rather do it from within the action so that > when I look at the action code I can clearly see what I did rather > than spending time scratching my head and wondering why my action is > displaying a non-default template. > > Thanks for any input. > > ... doug > > > > >-- Sincerely, William Pratt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks, Bill, for the input. So, am I to conclude that
render :template (unlike just plain ''render'') terminates
execution of
the action or do I need to add ''and return'' to make sure that
the
action terminates at that point? Thanks.
... doug
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
If you want to terminate at that point, you will have to add ''and return''. --Bill doug wrote:> Thanks, Bill, for the input. So, am I to conclude that > render :template (unlike just plain ''render'') terminates execution of > the action or do I need to add ''and return'' to make sure that the > action terminates at that point? Thanks. > > ... doug > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---