Rails admin的安装方式如下:
Rails.application.routes.draw do
mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
...
end
当我尝试将管理路径设置为环境变量时,如下所示:
Rails.application.routes.draw do
mount RailsAdmin::Engine => ENV['ADMIN_PATH'], as: 'rails_admin'
...
end
我得到以下异常:
.../ruby-2.1.1/gems/actionpack-4.1.0/lib/action_dispatch/routing/mapper.rb:507:in
`mount': A rack application must be specified (RuntimeError)
有人能指出我正确的方向吗?