【发布时间】:2011-07-26 20:57:01
【问题描述】:
假设像 Thread (id, uuid) 这样的模型,uuid 是唯一生成的标识符。我想更改默认路由:
edit_thread GET /threads/:id/edit(.:format) {:action=>"edit", :controller=>"threads"}
thread GET /threads/:id(.:format) {:action=>"show", :controller=>"threads"}
PUT /threads/:id(.:format) {:action=>"update", :controller=>"threads"}
不使用 :id 而是使用用户 :uuid --- 这在 Rails/routes.rb 中是如何实现的?
谢谢
【问题讨论】:
标签: ruby-on-rails ruby ruby-on-rails-3