deepak3
(deepak)
January 20, 2013, 1:11pm
1
hi,
I have a route which says:
UUID_REGEX = /^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{2})([0-9a-f]{2})-([0-9a-f]{12})$/
resources :checkout, :only => [:show, :create], :constraints => { :id => UUID_REGEX }
I get an error saying:
Regexp anchor characters are not allowed in routing requirements
full stacktrace is at config_routes.rb · GitHub
Why are anchor characters not allowed in routing requirements ?
I am using Rails 3.2.11
from http://www.stephensykes.com/blog_perm.html?133
This is because these regexes are now automatically anchored at the start and end of the path component. Just removing the anchors from your regex fixes it.
deepak3
(deepak)
January 21, 2013, 6:20am
3
ah. thanks Dheeraj
that was one old article
but still useful
deepak3
(deepak)
January 21, 2013, 6:24am
4
rails guides also mentions it on
Rails Routing from the Outside InThis guide covers the user-facing features of Rails routing.After reading this guide, you will know: How to interpret the code in config/routes.rb. How to construct your own routes, using either the preferred...