ここで尋ねられた質問に関連する - Rails resources routing のデフォルトのセグメント名。
名前空間のプレフィックス (つまり、/:apple_id/oranges/) なしでリソースを生成しようとするエッジ レールで問題が発生しました。プラグインを使用すると //:apple_id/oranges?
これを行う簡単な方法はありますか?たぶん2.2の問題?
ここで尋ねられた質問に関連する - Rails resources routing のデフォルトのセグメント名。
名前空間のプレフィックス (つまり、/:apple_id/oranges/) なしでリソースを生成しようとするエッジ レールで問題が発生しました。プラグインを使用すると //:apple_id/oranges?
これを行う簡単な方法はありますか?たぶん2.2の問題?
私がしたことは、全体を名前空間から完全に外したことです
map.resources :fruits, :path_prefix => ":apple_id", :name_prefix => "apple_"
そしてそれは
apple_fruits GET /:apple_id/fruits {:controller=>"fruits", :action=>"index"}
formatted_apple_fruits GET /:apple_id/fruits.:format {:controller=>"fruits", :action=>"index"}
POST /:apple_id/fruits {:controller=>"fruits", :action=>"create"}
POST /:apple_id/fruits.:format {:controller=>"fruits", :action=>"create"}
new_apple_fruit GET /:apple_id/fruits/new {:controller=>"fruits", :action=>"new"}
formatted_new_apple_fruit GET /:apple_id/fruits/new.:format {:controller=>"fruits", :action=>"new"}
edit_apple_fruit GET /:apple_id/fruits/:id/edit {:controller=>"fruits", :action=>"edit"}
formatted_edit_apple_fruit GET /:apple_id/fruits/:id/edit.:format {:controller=>"fruits", :action=>"edit"}
apple_fruit GET /:apple_id/fruits/:id {:controller=>"fruits", :action=>"show"}
formatted_apple_fruit GET /:apple_id/fruits/:id.:format {:controller=>"fruits", :action=>"show"}
PUT /:apple_id/fruits/:id {:controller=>"fruits", :action=>"update"}
PUT /:apple_id/fruits/:id.:format {:controller=>"fruits", :action=>"update"}
DELETE /:apple_id/fruits/:id {:controller=>"fruits", :action=>"destroy"}
DELETE /:apple_id/fruits/:id.:format {:controller=>"fruits", :action=>"destroy"}
これは私にとってはうまくいきました、それがあなたにとってもうまくいくことを願っています:)