我想在' routes.rb'。中创建网址
我有一个资源' Source'和source_controller有'索引'方法。
为了达到' index',我希望用户插入一个包含两个参数的网址:
源/ {类型} / {IDS} /索引
我在路线中写的代码有效:
resources :sources, param: :types, :only => :index do
member do
get ':ids/index' => 'source#index'
end
end
它有效,但有没有办法以更优雅的方式做到这一点? (以某种方式将id添加到资源中)