Routing is backbone of a web applications. When we are building applications using Rails we can manage routing for our app easily. I am going to explain a bit advance feature of routing in Rails
What is routing constraints
Few many times we require routes to behave differently and also want to do some routing based on specific conditions.
Constraint routes for http methods( put, post )
Want to show different home page for different users.
Want to restrict URL for some sub domain or range of IP addresses
We can easily constraints our routes in Rails
How many ways we can constraint our routes
Segment Constraints(Parameter Restriction)
You can filter any parameter based on Regular expression
Read on →