DRYest路由配置非REST控制器及其操作

时间:2011-11-12 04:21:55

标签: ruby-on-rails ruby routing rails-routing

相当肯定我做错了。我该怎么干?

controller 'foo' do
  get  'foo/bar', :action => 'bar', :as => 'foo_bar'
  post 'foo/bar', :action => 'bar', :as => 'foo_bar'
  post 'foo/baz', :action => 'baz', :as => 'foo_baz'
end

1 个答案:

答案 0 :(得分:0)

rake routes显示与此相同的路由:

get 'foo/bar'
post 'foo/bar'
post 'foo/baz'