我有一个名为status
的控制器,其中有许多方法,例如first
、second
等等。
所以,我的routes.rb
文件看起来像这样:
scope 'status', controller: :status do
get 'first'
get 'second'
# and so on
end
我也有一个路径,应该看起来像 '/status/states':
scope :status do
resources :states
end
如何将这些作用域合并到一个作用域中,以使用DRY和简洁的代码?