I’m trying to implement a custom route in rails
match '/:slug' => "products#get_by_slug", :as => :get_by_slug
If I dont have a corresponding view (get_by_slug.html.erb), I get a Template missing error
If I add that view, I get a Routing Error:
No route matches {:controller=>"products"}
How can I get my custom route to invoke the corresponding view?
Many Thanks
You probably have an error in the get_by_slug.html.erb template. Does it generate error if you make the file empty?