[Rails] Using the symbol '-' in route will cause error
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home