Forum: Ruby on Rails Why are anchor characters not allowed in routing requirements ?

Posted by Deepak Kannan (dkannan)
on 2013-01-20 14:12
(Received via mailing list)
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 https://gist.github.com/4578503

Why are anchor characters not allowed in routing requirements ?

I am using Rails 3.2.11

--
deepak
https://gist.github.com/deepak
Posted by Dheeraj Kumar (Guest)
on 2013-01-20 14:25
(Received via mailing list)
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.


--
Dheeraj Kumar
Posted by Deepak Kannan (dkannan)
on 2013-01-21 07:21
(Received via mailing list)
ah. thanks Dheeraj

that was one old article :-)
but still useful
Posted by Deepak Kannan (dkannan)
on 2013-01-21 07:26
(Received via mailing list)
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.