I have a Rails server where nginx routes /
to /api
, and I have rails_admin gem installed. I can access the admin panel at /api/admin
, but all the models listed on the admin page link to /admin/:model
. I can't seem to find a way to get the links to route to /api/admin/:model
instead.
I have set the following in application.rb
:
config.relative_url_root = "/api"
config.action_controller.relative_url_root = "/api"
ENV['RAILS_RELATIVE_URL_ROOT'] = "/api"
ENV['ROOT_URL'] = "/api"
But the admin page links have not changed.
If I change routes.rb
to have rails_admin under a namespace, the problem is not fixed: the admin page now becomes api/api/admin
and the links go to api/admin/:model
, but with the routes it requires api/api/admin/:model
instead.
How can I fix this?