Hello, Is there a way I can determine in my .rhtml as to what controller is currently being executed? (perhaps an environment variable?) For example, if my controller is named "display", and I put: <%= WHATEVER_SHOULD_BE_HERE %> then it would output: display thanks, Sean --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
params[:controller] I believe. Jason On 3/28/07, Sean Lerner <lerner.sean-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hello, > > Is there a way I can determine in my .rhtml as to what controller is > currently being executed? (perhaps an environment variable?) > > For example, if my controller is named "display", and I put: > > <%= WHATEVER_SHOULD_BE_HERE %> > > then it would output: > > display > > thanks, > > Sean > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
<%= controller.controller_name %> Will print the name of the current controller. Hope this helps, -- Paul On Mar 28, 8:30 pm, "Sean Lerner" <lerner.s...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > Is there a way I can determine in my .rhtml as to what controller is > currently being executed? (perhaps an environment variable?) > > For example, if my controller is named "display", and I put: > > <%= WHATEVER_SHOULD_BE_HERE %> > > then it would output: > > display > > thanks, > > Sean--~--~---------~--~----~------------~-------~--~----~ 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... I realized it a few minutes after I posted -- it''s been staring me in the face all this time (that is params[:controller] => display in development mode). My head''s cloudy this afternoon, and I should know better than to post to the list for help with a cloudy head. On Mar 28, 3:37 pm, "mudge" <paul.mu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> <%= controller.controller_name %> > > Will print the name of the current controller. > > Hope this helps, > > -- Paul > > On Mar 28, 8:30 pm, "SeanLerner" <lerner.s...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hello, > > > Is there a way I can determine in my .rhtml as to what controller is > > currently being executed? (perhaps an environment variable?) > > > For example, if my controller is named "display", and I put: > > > <%= WHATEVER_SHOULD_BE_HERE %> > > > then it would output: > > > display > > > thanks, > > > Sean--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---