Hi Ed;

I sent this to Ignacio and then found your semi-related post, and figured 
the more eyes the better. I also have an app hosted in a non-root location 
and (after considerable debugging) discovered a problem in 
hobo/hobo_route_helper.rb:76 (in Hobo 2.2.6). I wondering if you also think 
this to be a problem, and related to your issue? 

Here's the line from hobo_route_helper:

if Rails.application.config.action_controller.relative_url_root
  base_url = 
url.gsub(/^#{Rails.application.config.action_controller.relative_url_root}/, 
"")
end

In my app, I've set relative_url_root to "/app/lts-test" and and my 
default_url_options are also set as follows:

         { :host => 'example.com', 
           :protocol => "https", 
           :port => nil, 
           :only_path => false, 
           :script_name => '/app/lts-test' }

Notice that my host is a full URL (which I normal, I guess): example.com

When Hobo calls into its route_helper, though, the regex is set to look for 
my relative_url_root at the *beginning* of the string ("gsub(/^#{Rails...."), 
which fails because at this point my url is actually this:

https://example.com/app/lts-test/users/1/edit

This means, the "/app/lts-test" part isn't being removed, causing other 
failures such as this:

recognize_path has failed: No route matches "
https://example.com/app/lts-test/user/1/edit";

I tried switching my default_url_options to be :only_path => true which 
partly solves the problem, but then causes trouble with other routes that 
expect a full path, even ones that within Hobo that I've not overridden. 

So, does this strike you as an error? Why would the relative_url_root be 
searched for only at the *beginning* of the string? It seems to make more 
sense to remove it from anywhere in the entire url string. 

Your thoughts? 
Tim









On Thursday, June 15, 2017 at 9:57:48 PM UTC-4, Ed Gomolka wrote:
>
> I'm not sure if this is related, but I submitted a pull request for a 
> problem that I was having when I tried to locate my Hobo application in a 
> non-root location. Hobo has a variable called page_path returns the full 
> path. It messes things up if you are setting RAILS_RELATIVE_URL_ROOT.
>
> Here is the pull request: https://github.com/Hobo/hobo/pull/194
>
>
> On Tuesday, June 13, 2017 at 9:54:19 AM UTC-6, kevinpfromnm wrote:
>>
>> Subject pretty much sums it up. I have part updates working in dev, but 
>> production is on passenger. To confirm that it's the relative url path 
>> breaking it, I configured dev similarly. It looks like the recognized_path 
>> call fails to account for the relative path
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to