我稍稍加关注这个问题,我找到一种可能帮助你改善的解决办法。
Step 1
<>strong>BEFORE, 您可生成你的耳光,确保能够在inflections.rb
文档中适当展示。
ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular pokem , pokemon
end
Step 2
现在,你可以产生你的耳光。
[bruno ~/pokedex]$ script/generate scaffold pokem name:string
Step 3
检查你的新路线!
[bruno ~/pokedex]$ rake routes
pokemon GET /pokemon(.:format) {:controller=>"pokemon", :action=>"index"}
POST /pokemon(.:format) {:controller=>"pokemon", :action=>"create"}
new_pokem GET /pokemon/new(.:format) {:controller=>"pokemon", :action=>"new"}
edit_pokem GET /pokemon/:id/edit(.:format) {:controller=>"pokemon", :action=>"edit"}
pokem GET /pokemon/:id(.:format) {:controller=>"pokemon", :action=>"show"}
PUT /pokemon/:id(.:format) {:controller=>"pokemon", :action=>"update"}
DELETE /pokemon/:id(.:format) {:controller=>"pokemon", :action=>"destroy"}
Note
如果你在之前产生你的耳光,你将不更新所标明的路线。