0
由于我的routes.rb文件的组织方式,我总是收到奇怪的错误。最新的一个是某些功能在模型关系控制器中找不到动作“显示”(动作显然存在)。我想这是因为我通过集合添加了一些自定义操作,并且关于声明路由的顺序有些混乱。有人可以看看这个并说出了什么问题吗?Rails中正确的资源顺序routes.rb
YApp::Application.routes.draw do
require 'resque/server'
match 'login' => 'user_sessions#new', :as => :login
match 'logout' => 'user_sessions#destroy', :as => :logout
match '/get_idx', :to => 'nodes#get_idx'
resource :relations do
collection do
post 'this_relation'
post "iframize"
end
end
resource :words do
get 'page/:page', :action => :index, :on => :collection
collection do
get 'front'
get 'index'
end
end
resource :recommendations do
collection do
get 'find_votes'
end
end
get "connotation/create"
get "connotation/edit"
get "connotation/update"
root :to => "words#front", :as => :homepage
resources :users, :user_sessions, :relations, :evaluation, :phrases, :metawords, :nodes, :recommendations, :words
mount Resque::Server.new, :at => "/resque"
match 'about' => 'words#index' , :as => :about
match 'contact' => 'keywords#index' , :as => :contact
end
显示耙路线的结果CONTROLLER =关系 –