0

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
4

1 に答える 1

1

You might have an issue with resource :relations. Rule of thumb is: if you use the plural resources, then the name of the resource must also be plural (i.e. :relations), if you use resource, in singular, than you should use singular for the resource name too (i.e. :relation).

Other possible problems: your indentation is off. Maybe it's just a copy-paste issue, but check it nonetheless, because you might have some unexpected nesting going on.

Also inspect rake routes CONTROLLER=relations. Compare that to the log of the failed request and see if every parameter matches up.

于 2012-06-11T19:53:03.950 に答える