Question

I have an app somewhere like myapp.com and rails_admin installed. So here is my admin route:

  mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'
  devise_for :users

And ofc admin page is reached in myapp.com/admin. There I can sign in, make request to myapp.com/users/sign_in and this will work nice.

Now:

Lets imagine that my app is reached through myapp.com/uk/ address. So here is changed route file:

  mount RailsAdmin::Engine => 'admin', :as => 'rails_admin'
  devise_for :users

Now I can go to myapp.com/uk/admin and get an admin login page. But when I try to login, rails_admin makes a request to /users/sign_in, so it goes to myapp.com/users/sign_in, not to myapp.com/uk/users/sign_in.

How can I fix this thing?

EDIT:

ok, and what about when my app is on my server, and procedure is:

  1. user goes to www.verycoolapp.com/uk/
  2. this app watches my server www.myapp.com

I want my admin panel to be available on www.verycoolapp.com/uk/admin not on www.myapp.com/admin

Was it helpful?

Solution

You could try setting the "root" URL to include the subfolder: Rails app in a subdirectory

#config/application.rb
config.relative_url_root = "/app1"

Rails guide on the issue

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top