1

配置设计后,我可以使用这些路线:

new_user_session GET    /users/sign_in(.:format)       devise/sessions#new
        user_session POST   /users/sign_in(.:format)       devise/sessions#create
destroy_user_session DELETE /users/sign_out(.:format)      devise/sessions#destroy
       user_password POST   /users/password(.:format)      devise/passwords#create
   new_user_password GET    /users/password/new(.:format)  devise/passwords#new
  edit_user_password GET    /users/password/edit(.:format) devise/passwords#edit
                     PUT    /users/password(.:format)      devise/passwords#update
cancel_user_registration GET    /users/cancel(.:format)        devise/registrations#cancel
   user_registration POST   /users(.:format)               devise/registrations#create
new_user_registration GET    /users/sign_up(.:format)       devise/registrations#new
edit_user_registration GET    /users/edit(.:format)          devise/registrations#edit
                     PUT    /users(.:format)               devise/registrations#update
                     DELETE /users(.:format)               devise/registrations#destroy
               about GET    /about(.:format)               pages#about
                root        /                              pages#home

现在我在 home.html.erb 文件中使用它:

<p> 
<%= link_to 'Sign up now!',  new_user_regsitration_path , class: "btn btn-large btn-primary" %>
</p>

每次我运行服务器时,我都会收到此路由错误:

No route matches [GET] "/"

请帮忙?

4

2 回答 2

6

如果没有任何帮助,只需重新启动您的服务器。我有同样的错误,无法弄清楚发生了什么!

于 2013-03-25T11:03:20.170 回答
1

您在主页上的链接中有错字:

new_user_regsitration_path

应该:

new_user_registration_path
于 2013-03-25T10:28:25.773 回答