Closed allspiritseve closed 11 years ago
What do you think about :constraints => { :year => /\d{4}/, :month => /\d{1,2}/ }
- this way month can be specified as one or two numbers (1 or 12) instead of constraining it to two numbers (01 or 12)
Good call... just updated the commit.
Thanks @allspiritseve!
Instead of throwing an exception when a route like /news/archive/2012/whatever is accessed, Rails will return a 404 since the route won't match anymore.
Please let me know if my regex is too specific. I assumed years would be four numbers and months would be two numbers, and everything else would not match.