Frexuz
Frexuz

Reputation: 4943

Rails 3 routes - URL name?

I'm not sure how to change a route's URL. As the :as parameter does something else now than in Rails 2

This only changes the route helpers to faq_path, but the url still goes to /faqs. I want the url to be singular.

resources :faqs, :as => "faq" do
  collection { post :sort }
end

Doing a single match (below) won't really be the same

match "/faq" => "faqs#index"

Upvotes: 0

Views: 462

Answers (1)

lucapette
lucapette

Reputation: 20724

If you want change all the URLs related to the faqs resources you can do the following:

resources :faqs, :path => 'faq'

See docs for further information.

Upvotes: 4

Related Questions