read
Rails routes can be customized to include your own parameters inside it. Lets first understand how named routes works:
Adding dynamic parameters to routes
Here exact parameters are matched to route and presence of each parameter is mandatory in order to construct urls. If blank parameter is supplied then it will raise RoutingError
exception.
Exact matched named route declared as :
rails console :
## Bound parameters to named routes
If you are sure that certain parameters can be blank then you can define them as optional parameter inside route