我有一个使用Spina CMS,
的Rails应用程序我希望登录页面\
是admin中的页面之一。
例如localhost:3000\home
是我的localhost:3000
当前获得404设置root :to => 'pages#home'
routes.rb
Rails.application.routes.draw do
match '(*any)', to: redirect(subdomain: ''), via: :all, constraints: {subdomain: 'www'}
mount Spina::Engine => '/'
root :to => 'pages#home' # => not working...
get '/*id' => 'pages#show', as: "page", controller: 'pages', constraints: lambda { |request|
!(request.env['PATH_INFO'].starts_with?('/rails/') || request.env['PATH_INFO'].starts_with?("/#{Spina.config.backend_path}") || request.env['PATH_INFO'].starts_with?('/attachments/'))
}
end
答案 0 :(得分:0)
在路线页面中,将root :to => 'pages#home'
替换为root 'pages#home'
并添加
resources :pages
让我知道这是否适合您:)