【发布时间】:2012-08-14 19:26:36
【问题描述】:
我今天刚开始使用 devise,我修改了 session#new.html.erb 文件以满足我的需要。我创建了一个名为 Register has follow 的链接
<%= link_to "REGISTER", "new_customer_registration_path" %>
但是,当我点击链接时,它会将我引导至无路由错误
Routing Error
No route matches [GET] "/customers/new_customer_registration_path"
这是我的 rake 路线
new_customer_session GET /customers/sign_in(.:format) devise/sessions#new
customer_session POST /customers/sign_in(.:format) devise/sessions#create
destroy_customer_session DELETE /customers/sign_out(.:format) devise/sessions#destroy
customer_password POST /customers/password(.:format) devise/passwords#create
new_customer_password GET /customers/password/new(.:format) devise/passwords#new
edit_customer_password GET /customers/password/edit(.:format) devise/passwords#edit
PUT /customers/password(.:format) devise/passwords#update
cancel_customer_registration GET /customers/cancel(.:format) devise/registrations#cancel
customer_registration POST /customers(.:format) devise/registrations#create
new_customer_registration GET /customers/sign_up(.:format) devise/registrations#new
edit_customer_registration GET /customers/edit(.:format) devise/registrations#edit
PUT /customers(.:format) devise/registrations#update
DELETE /customers(.:format) devise/registrations#destroy
events GET /events(.:format) events#index
POST /events(.:format) events#create
new_event GET /events/new(.:format) events#new
edit_event GET /events/:id/edit(.:format) events#edit
event GET /events/:id(.:format) events#show
PUT /events/:id(.:format) events#update
DELETE /events/:id(.:format) events#destroy
root / events#index
我的路线文件他已经跟随
devise_for :customers
resources :events
root :to => 'events#index'
match '/new_customer_registration' => "devise/registrations#new"
我被重定向到发生错误的页面。
http://localhost:3000/customers/new_customer_registration_path
我该如何使用它?提前致谢
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.1 devise