Correct order of resources in Rails routes.rb -


i keep getting strange errors because of way routes.rb file organized. latest 1 function cannot find action "show" in model relations controller (the action there). guess because adding custom actions via collection , order in routes declared messed up.. can please have @ , wrong?

yapp::application.routes.draw    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     collection       post 'this_relation'       post "iframize"     end   end     resource :words   'page/:page', :action => :index, :on => :collection     collection       'front'       'index'     end   end      resource :recommendations       collection         'find_votes'       end     end     "connotation/create"    "connotation/edit"    "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 

you might have issue resource :relations. rule of thumb is: if use plural resources, name of resource must plural (i.e. :relations), if use resource, in singular, should use singular resource name (i.e. :relation).

other possible problems: indentation off. maybe it's copy-paste issue, check nonetheless, because might have unexpected nesting going on.

also inspect rake routes controller=relations. compare log of failed request , see if every parameter matches up.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -