Creating a nested route for a collection as opposed to a member

When I create a nested route it creates one for the member.

  resources "/my_items", ItemController do
    get "/route123", Item.SubItemController, :route123 
  end 

      

The route will be "/ my_items /: id / route123". How do I create the same nested route, but for a collection?

"/ my_items / route123"

+3


source to share


1 answer


There are no collection routes inside resources, but you can always do

get "/my_items/route123", Item.SubItemController, :route123

      



before resources.

Copied from @ dogbert's comment.

0


source







All Articles