Hi all, I want something like action_name in my controller which could store the current path, say /categories/1;edit. Is there any way to get this? Thanks. allen --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jon Garvin
2007-Jul-03 14:45 UTC
Re: How can I get the current path which is processed by rails?
allen wrote:> Hi all, > > I want something like action_name in my controller which could store > the current path, say /categories/1;edit. Is there any way to get > this? Thanks. > > > allen > >There''s lots of interesting stuff to be found in the ENV hash. Such as... ENV[''REQUEST_PATH''] -- http://www.5valleys.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 -~----------~----~----~----~------~----~------~--~---
andrew.ohnstad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-03 15:03 UTC
Re: How can I get the current path which is processed by rails?
Is there a list anywhere of what all is usually in ENV? Thanks! On Jul 3, 10:45 am, Jon Garvin <jgarvin.li...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> allen wrote: > > Hi all, > > > I want something like action_name in my controller which could store > > the current path, say /categories/1;edit. Is there any way to get > > this? Thanks. > > > allen > > There''s lots of interesting stuff to be found in the ENV hash. Such as... > > ENV[''REQUEST_PATH''] > > --http://www.5valleys.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 -~----------~----~----~----~------~----~------~--~---
Jon Garvin
2007-Jul-03 15:23 UTC
Re: How can I get the current path which is processed by rails?
andrew.ohnstad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Is there a list anywhere of what all is usually in ENV? > > Thanks! >It depends on your sever setup, but doesn''t usually change unless the admin responsible for the server changes it. Try pasting this temporarily in one of your views... ENV <ul> <% ENV.keys.each do |key| %> <li>ENV[''<%= key %>''] = <%= ENV[key] %></li> <% end %> </ul> request.env <ul> <% request.env.keys.each do |key| %> <li>request.env[''<%= key %>''] = <%= request.env[key] %></li> <% end %> </ul> That should give you a list of everything currently available. Note that I originally forgot about ''request.env'' which provides some more info. -- http://www.5valleys.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 -~----------~----~----~----~------~----~------~--~---