deepak
2013-Jan-20 13:11 UTC
Why are anchor characters not allowed in routing requirements ?
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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/gFD86J5vyksJ. For more options, visit https://groups.google.com/groups/opt_out.
Dheeraj Kumar
2013-Jan-20 13:23 UTC
Re: Why are anchor characters not allowed in routing requirements ?
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 On Sunday 20 January 2013 at 6:41 PM, deepak wrote:> 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 > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org (mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org). > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org (mailto:rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org). > To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/gFD86J5vyksJ. > For more options, visit https://groups.google.com/groups/opt_out. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
deepak
2013-Jan-21 06:20 UTC
Re: Why are anchor characters not allowed in routing requirements ?
ah. thanks Dheeraj that was one old article :-) but still useful On Jan 20, 6:23 pm, Dheeraj Kumar <a.dheeraj.ku...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> fromhttp://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 > > On Sunday 20 January 2013 at 6:41 PM, deepak wrote: > > > > > > > > > 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 athttps://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 > > -- > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org (mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org). > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org (mailto:rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org). > > To view this discussion on the web visithttps://groups.google.com/d/msg/rubyonrails-talk/-/gFD86J5vyksJ. > > For more options, visithttps://groups.google.com/groups/opt_out.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
deepak
2013-Jan-21 06:24 UTC
Re: Why are anchor characters not allowed in routing requirements ?
rails guides also mentions it on http://guides.rubyonrails.org/routing.html#segment-constraints On Jan 21, 11:20 am, deepak <kannan.dee...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> ah. thanks Dheeraj > > that was one old article :-) > but still useful > > On Jan 20, 6:23 pm, Dheeraj Kumar <a.dheeraj.ku...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > fromhttp://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 > > > On Sunday 20 January 2013 at 6:41 PM, deepak wrote: > > > > 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 athttps://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 > > > -- > > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm (mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org). > > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org (mailto:rubyonrails-talk+unsubscribe-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm). > > > To view this discussion on the web visithttps://groups.google.com/d/msg/rubyonrails-talk/-/gFD86J5vyksJ. > > > For more options, visithttps://groups.google.com/groups/opt_out.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.