Is there a way to have a route allow an :id or a nil?
For example:
match 'product_specs/:id' => 'home#product_specs',
:as => :product_specs,
:via => :get
takes the id as a param. But I’d also like to pass an empty param like this product_specs_path() so that I can also have the option of loading all my records.
Is there a routes match that can achieve this?
perhaps if you use the optional parameter as
Would something like that work?