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.

On 11 March 2011 09:11, jaron [email protected] 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?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs