Reputation: 766
So, I'm painfully new to Rails, but I'm trying to build a web application with it.
I just created a new url in config/routes.rb at localhost:3000/products/toyota.
get 'products/toyota', to: 'static#products#toyota'
The homepage (localhost:3000 on my local machine) and products page (localhost:3000/products) already exist. So, I want my new toyota page to have a view that's independent from the products page but the localhost:3000/products/toyota page keeps rendering the haml/javascript files from the products page.
Any ideas on how to fix that?
Upvotes: 0
Views: 40
Reputation: 4427
your routes in file is incorrect. Correct way is:
get 'products/toyota', to: 'static#toyota' # "controller_name#action"
and keep this route above resources :products
Upvotes: 1