I have a set of products that I want available with the full file path and helper functions, but I want to shorten their URLs. Like this:
And I would like that to route like this:
product_foobar GET /p/fb(.:format) products/foobar#show
Product is just a namespace, so I know I can namespace it in the routes:
namespace :product do
But that results in this route:
product_foobar GET /product/foobar(.:format) product/foobars#show
Is it possible to just alias the URL like that?
Found it. Add this line to routes.rb:
get '/p/fb' => "product/foobar#show"