Problem with Ruby on Rails

I have a controller called head_buses_controller.rb, and in my routes it displays like thismap.resources :head_buses

As a result, the URLs will be http://domain.com/head_buses

I would like to have urls with dashes -instead of underscores _.

Is it possible for URLs with dashes to go to the head_buses controller?

Greetings

Eef

+3
source share
1 answer

Try using this:

resources :head_buses, :as => 'head-buses'
+4
source

Source: https://habr.com/ru/post/1794095/


All Articles