2011-12-12 52 views
2

我得到色器件的問題。每次我打電話,應該由色器件(例如http://localhost:3000/users/sign_up)我結束了以下錯誤處理的網址:與色器件路由錯誤{:控制器=>「設計/靜態」,:動作=>「約」}

No route matches {:controller=>"devise/static", :action=>"about"} 

希望有人能幫幫我!


的routes.rb

devise_for :users 

get "pages/contact" 
get "pages/imprint" 
get "pages/about" 

root :to => "pages#about" 

我所做的:

新增gem 'devise'到Gemfile中

bundle install 
rails generate devise:install 
rails generate devise User 
rake db:migrate 

耙[R歐特斯

 new_user_session GET /users/sign_in(.:format)  {:action=>"new", :controller=>"devise/sessions"} 
      user_session POST /users/sign_in(.:format)  {:action=>"create", :controller=>"devise/sessions"} 
    destroy_user_session DELETE /users/sign_out(.:format)  {:action=>"destroy", :controller=>"devise/sessions"} 
      user_password POST /users/password(.:format)  {:action=>"create", :controller=>"devise/passwords"} 
     new_user_password GET /users/password/new(.:format) {:action=>"new", :controller=>"devise/passwords"} 
     edit_user_password GET /users/password/edit(.:format) {:action=>"edit", :controller=>"devise/passwords"} 
         PUT /users/password(.:format)  {:action=>"update", :controller=>"devise/passwords"} 
cancel_user_registration GET /users/cancel(.:format)  {:action=>"cancel", :controller=>"devise/registrations"} 
     user_registration POST /users(.:format)    {:action=>"create", :controller=>"devise/registrations"} 
    new_user_registration GET /users/sign_up(.:format)  {:action=>"new", :controller=>"devise/registrations"} 
    edit_user_registration GET /users/edit(.:format)   {:action=>"edit", :controller=>"devise/registrations"} 
         PUT /users(.:format)    {:action=>"update", :controller=>"devise/registrations"} 
         DELETE /users(.:format)    {:action=>"destroy", :controller=>"devise/registrations"} 
      pages_contact GET /pages/contact(.:format)  {:controller=>"pages", :action=>"contact"} 
      pages_imprint GET /pages/imprint(.:format)  {:controller=>"pages", :action=>"imprint"} 
      pages_about GET /pages/about(.:format)   {:controller=>"pages", :action=>"about"} 
        root  /       {:controller=>"pages", :action=>"about"} 

Rails的版本: 的Rails 3.1.3


PagesController

class PagesController < ApplicationController 
    def contact 
    end 

    def imprint 
    end 

    def about 
    end 

end 
+1

我跟着on Rails的3.1.3你的腳步,我無法重現您遇到的問題。這似乎是Devise干擾你的非Devise路線的問題,但我不明白爲什麼會發生這種情況。你的PagesController有什麼奇怪的事情發生嗎? –

+0

我添加了頁面控制器的內容(這正是rails g命令生成的內容)。我的Rails版本也是3.1.3 ... – Mark

+1

奇怪,我只是發現問題可能是。在application.html.erb中...我有三個鏈接到PagesController中的頁面... <%= link_to「Imprint」,:controller =>:pages,:action =>:imprint%>如果我刪除它們錯誤消失了。但爲什麼? – Mark

回答

1

我的錯誤,當我改變了我的link_to方法是固定的。

在我的頭我有:

<%= link_to "Info", :controller => :info %> 

,當我打開它:

<%= link_to "Info", "/info" %> 

不見了錯誤!

+0

我有同樣的問題http://stackoverflow.com/questions/14226107/devise-invitable-routing-error並解決了您的建議。謝謝。 – zabumba

相關問題