【发布时间】:2010-03-13 14:40:50
【问题描述】:
我有一个名为 profile 的命名路由,我希望能够以 json 格式访问它。但是当我查看我的 rake 路由输出时,我发现 (.:format) 丢失了。如何将其添加到命名路由?
user GET /users/:id(.:format) {:action=>"show", :controller=>"users"}
profile /:username {:action=>"show", :controller=>"users"}
提前致谢!
【问题讨论】:
标签: ruby-on-rails ruby format named-routing