我正在使用 Rails 4 并试图包含 koudoku stripe gem。这是我的路线:
# Added by Koudoku.
mount Koudoku::Engine, at: 'koudoku'
scope module: 'koudoku' do
get 'pricing' => 'subscriptions#index', as: 'pricing'
end
resource :account
devise_for :users, :skip => [:sessions]
as :user do
get '/login' => 'devise/sessions#new', :as => :new_user_session
post '/login' => 'devise/sessions#create', :as => :user_session
get '/logout' => 'devise/sessions#destroy', :as => :destroy_user_session
end
get '/dashboard', to: 'dashboard#index'
get '/reports/generate', to: 'reports#generate'
authenticated :user do
root :to => 'dashboard#index', :as => :authenticated_root
end
root :to => redirect('/login')
这是我得到的错误:
undefined local variable or method `root_url
我可以很好地访问其他路由,它只是试图从模块路由呈现应用程序助手方法(例如,我定义的自定义应用程序方法或路由方法)......这有意义吗?我该如何解决?