Skip to content

'Rails.application.config.relative_url_root' does not alter route helpers output. #22074

@maxcal

Description

@maxcal

As per the documentation on http://guides.rubyonrails.org/configuring.html#deploy-to-a-subdirectory-relative-url-root I set the ENV var RAILS_RELATIVE_URL_ROOT = "/app1".

I setup a basic route:

Rails.application.routes.draw do
  root 'pages#home'
  resources :cats, only: [:show, :index]
end

To test this I output:

# views/pages/home.html.erb
<pre>
  <%= cats_url %>
  <%= cats_path %>
  <%= Rails.application.config.relative_url_root %>
</pre>

The output is:

  http://localhost:3000/cats
  /cats
  /app1

Not http://localhost:3000/app1/cats as could be expected.

Sorry if there is no test to go along with this issue but I currently have really limited bandwidth and cannot download the whole rails repo to set it up.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions