我有以下型號我使用... 遊戲 class Game < ActiveRecord::Base
has_many :workout
has_many :participations
end
參與 class Participation < ActiveRecord::Base
belongs_to :player
belongs_to :game
我正在開發一個簡單的預訂應用程序。這裏是我的路線 resources :users do
get 'reservations', on: :member
end
resources :listings do
resources :reservations
end
當我嘗試預約,動作reservations#new帶我到reservations_path。當然,我得到
我想在Rails 4中將一些數據導出爲CSV。我有兩個模型:Excursions和Inscriptions。一次遊覽有許多題詞,一次題詞屬於一次遊覽。 我有我嵌套的路線這樣定義的: resources :excursions do
resources :inscriptions
get 'exportcsv' => 'excursions#download'
end
如果我點擊我的編輯鏈接,鏈接將起作用,並將我帶到要編輯的特定圖庫的編輯表單。如果我點擊鏈接到新的爲同一控制器我收到以下錯誤: NoMethodError at /users/2/galleries/new
undefined method `galleries_path' for #<#<Class:0x007f4714fbac68>:0x000000060f32e0>
Did you mea