0

我有这个路线文件

 Qitch::Application.routes.draw do

     devise_for :users, :controllers => {
      :omniauth_callbacks => "users/omniauth_callbacks",
      :registrations => "users/registrations",
      :sessions => "users/sessions",
     :passwords => "users/passwords"
    }

   devise_for :users
    as :user do
    get '/sign_up', :to => "users/registrations#new"
    get "sign_out", :to => "users/sessions#destroy"
   end

  root :to => 'welcome#index'  
 end

当我在应用程序布局中单击此链接时

     <a href="/users/sign_up">Sign-up Now, It's fast and free</a>

我有这个错误

  Routing Error

  No route matches {:controller=>"users/welcome"}

  Try running rake routes for more information on available routes. 

我不明白为什么会这样

任何帮助

谢谢

4

1 回答 1

1

1.)作为路由错误提示,尝试运行rake 路由,它将显示所有已定义的路由,从输出中您可以看到您是否定义了不想要的东西

2.)如设计自定义路线中所述尝试类似:

get "/sign_up" => "devise/registrations#new"

3.) 使用视图中的路径:从代码生成路径和 url

<%= link_to "Login", signup_user_path %>
于 2012-09-20T21:15:28.567 回答