RailsSon
RailsSon

Reputation: 20647

Ruby on Rails Routes Issue

I have a controller called head_buses_controller.rb and in my routes have mapped it like so map.resources :head_buses

This results in URLs being http://domain.com/head_buses

I would however would like to have the URLs with a dash - instead of an underscore _.

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

Cheers

Eef

Upvotes: 3

Views: 182

Answers (1)

Matteo Alessani
Matteo Alessani

Reputation: 10422

Try to use this one:

resources :head_buses, :as => 'head-buses'

Upvotes: 4

Related Questions