0

handy_network_tools is my controller

search_camera is my action in the controller

I want to write the routes file in nested way.

  resources :handy_network_tools do
    collection do
      get :search_camera
    end
  end

I prefer handy_network_tools_search_camera rather than search_camera_handy_network_tools

Any ideas ?

search_camera_handy_network_tools GET    /handy_network_tools/search_camera(.:format)          handy_network_tools#search_camera
newBike
  • 14,385
  • 29
  • 109
  • 192

1 Answers1

1

Route helpers are automatically defined from child to parent. If you want to change the name of the route method, you can set it explicitly using as.

resources :handy_network_tools do
  collection do
    get :search_camera, as: :handy_network_tools_search_camera
  end
end
d_ethier
  • 3,873
  • 24
  • 31