我正在使用rails_admin作为主要应用程序,我希望通过/
而不是/admin
路径进行访问。
我当前的路线文件看起来像这样:
Rails.application.routes.draw do
mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
devise_for :users
root 'dashboard#index'
end
仪表盘只是一个简单的页面,带有指向我要摆脱的/admin
的链接。
[简单的mount RailsAdmin::Engine => '/', as: 'rails_admin'
无法解决,因为存在重定向循环(我想是根据设计得出的。)>
日志是
Thin web server (v1.6.4 codename Gob Bluth) Maximum connections set to 1024 Listening on 10.0.16.183:3000, CTRL+C to stop Started GET "/" for 10.0.16.244 at 2016-01-15 14:19:55 +0100 Cannot render console from 10.0.16.244! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255 ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations" Processing by RailsAdmin::MainController#dashboard as HTML Completed 401 Unauthorized in 12ms (ActiveRecord: 0.0ms) Started GET "/users/sign_in" for 10.0.16.244 at 2016-01-15 14:19:55 +0100 Cannot render console from 10.0.16.244! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255 Processing by RailsAdmin::MainController#show as HTML Parameters: {"model_name"=>"users", "id"=>"sign_in"} Completed 401 Unauthorized in 1ms (ActiveRecord: 0.0ms) Started GET "/users/sign_in" for 10.0.16.244 at 2016-01-15 14:19:55 +0100 Cannot render console from 10.0.16.244! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255 Processing by RailsAdmin::MainController#show as HTML Parameters: {"model_name"=>"users", "id"=>"sign_in"} Completed 401 Unauthorized in 1ms (ActiveRecord: 0.0ms) ... continues a couple of time after timeout
尝试过几件事,但没有解决。
有人可以帮忙吗?
我使用rails_admin作为主要应用程序,我希望通过/而不是/ admin路径对其进行访问。我当前的路由文件如下所示:Rails.application.routes.draw确实安装了RailsAdmin :: ...
是一个设计问题,我在https://github.com/sferik/rails_admin/wiki/Troubleshoot中找到了解决方案只好在发动机安装前更换装置。
您是否尝试过指定根地址?
对我来说,以下工作将具有管理员角色的用户直接重定向到rails_admin仪表板页面。