ibu*_*uck 24 routing ruby-on-rails
我正在尝试为我的楼宇控制器使用一个非常简单的资源路径.
resource :buildings
Run Code Online (Sandbox Code Playgroud)
这导致以下映射
buildings POST /buildings(.:format) {:controller=>"buildings", :action=>"create"}
new_buildings GET /buildings/new(.:format) {:controller=>"buildings", :action=>"new"}
edit_buildings GET /buildings/edit(.:format) {:controller=>"buildings", :action=>"edit"}
GET /buildings(.:format) {:controller=>"buildings", :action=>"show"}
PUT /buildings(.:format) {:controller=>"buildings", :action=>"update"}
DELETE /buildings(.:format) {:controller=>"buildings", :action=>"destroy"}
Run Code Online (Sandbox Code Playgroud)
任何人都知道为什么没有为默认/建筑物GET请求映射索引操作?我正在使用rails 3.0.3
Jer*_*ten 60
我想你想用resources
而不是resource
.你可以在这里阅读有关差异:http://api.rubyonrails.org/classes/ActionDispatch/Routing/Mapper/Resources.html#method-i-resource
归档时间: |
|
查看次数: |
5773 次 |
最近记录: |