Rafael Roque
2009-Oct-29 18:01 UTC
How to obtain the context path in a Jruby app on Tomcat?
Hi all, I successfully deployed my JRuby on Rails app on Tomcat In a jsp page I''d use ${pageContext.request.contextPath} to obtain my context path.How could I do this in a Ruby controller? Thanks Rafael Roque -- Posted via http://www.ruby-forum.com/.
digger250
2009-Oct-29 21:38 UTC
Re: How to obtain the context path in a Jruby app on Tomcat?
Try Rails.public_path
Conrad Taylor
2009-Oct-29 23:04 UTC
Re: How to obtain the context path in a Jruby app on Tomcat?
On Thu, Oct 29, 2009 at 11:01 AM, Rafael Roque < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi all, > I successfully deployed my JRuby on Rails app on Tomcat > In a jsp page I''d use ${pageContext.request.contextPath} to obtain my > context path.How could I do this in a Ruby controller? > > Thanks > Rafael Roque >What does the context path represent within JSP? -Conrad> -- > 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 -~----------~----~----~----~------~----~------~--~---
Nick Sieger
2009-Nov-02 19:53 UTC
Re: How to obtain the context path in a Jruby app on Tomcat?
On Thu, Oct 29, 2009 at 12:01 PM, Rafael Roque <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi all, > I successfully deployed my JRuby on Rails app on Tomcat > In a jsp page I''d use ${pageContext.request.contextPath} to obtain my > context path.How could I do this in a Ruby controller?JRuby-Rack exposes a controller method called #servlet_request. So you could try `servlet_request.context_path` inside a controller or view. /Nick