【发布时间】:2012-08-29 14:36:10
【问题描述】:
我有像http://example.com/posts/?tag=2这样的网址
我的routes.rb 是
resources :posts do
get 'tag', :on => :collection
end
我需要像http://example.com/posts/tag/linux这样的链接
我的桌子是:
posts(id,title)
tags(id,name)
taggings(id, post_id, tag_id)
【问题讨论】:
-
这里有几个选项:gist.github.com/1209732
标签: ruby-on-rails routes slug