views:

38

answers:

1

For some strange reason cardsets_path('my') generates "/cardsets.my" instead of "/cardsets/my". Please explain why?

config/routes.rb:

match '/cardsets/:type', :to => 'cardsets#index', :requirements => { :type => /my|public/ }, :as => 'cardsets'

resources :users do
  resources :cardsets do
  end
end

rake routes:

cardsets /cardsets/:type(.:format) {:controller=>"cardsets", :action=>"index"}
+2  A: 

Shouldn't it be

cardsets_path(:type => 'my')

However, type is a reserved word in rails.

mark