I want to route a URL like "http://localhost:3000/admin/product- details".I defined the route mapping in routes.rb: map.namespace :admin do |admin| # Directs /admin/products/* to Admin::ProductsController (app/ controllers/admin/products_controller.rb) admin.product_details ''/product-details(.:format)'', :controller=>"product_details", :action=>"index", :conditions=>{:method=>:get} admin.connect ''/product-details(.:format)'', :controller=>"product_details", :action=>"create", :conditions=>{:method=>:post} end When I visit the URL,Rails throw a error: ActionController::RoutingError: No route matches "/admin/product- details" with {} I visit http://localhost:3000/admin/product_details well. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Michael Pavling
2011-Mar-11 09:36 UTC
Re: Using the symbol ''-'' in route will cause error
On 11 March 2011 09:11, jaron <inepalon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I want to route a URL like "http://localhost:3000/admin/product- > details".I defined the route mapping in routes.rb:Can you not use an underscore? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.