dev@glassfish.java.net

Re: GlassFish Gem for Rails [WAS Re: GlassFish gem feature requests/bugs]

From: Charles Oliver Nutter <charles.nutter_at_sun.com>
Date: Fri, 14 Sep 2007 14:53:14 -0500

Changshin Lee wrote:
> Hi Arun,
>
> First of all, thanks for the nice work. I'd like to give quick feedback
> from using it for my project.
>
> I ran "springbook" project with glassfish_rails and
>
> http://localhost:8080/springbook/pages/3
>
> works fine. However, all the generated links to pages_controller are
> "/pages/xxx", not "/springbook/pages/xxx". I tried to use
>
> ActionController::AbstractRequest.relative_url_root = '/springbook'
>
> but it didn't work at all. Probably Grizzly JRuby connector may leave
> out the context path to Rails.

I ran into this too. You need to set two properties:

ActionController::AbstractRequest.relative_url_root = "/testapp/"
ActionController::CgiRequest.relative_url_root = "/testapp/"

- Charlie