On Thu, Sep 1, 2011 at 1:53 AM, 7stud -- <[email protected]> wrote:

> Conrad Taylor wrote in post #1019488:
> > Sent from my iPhone
> >
> > On Aug 31, 2011, at 1:21 PM, 7stud -- <[email protected]> wrote:
> >
> >>> be
> >>> something like the following:
> >>>
> >>> match '/:id' => 'users#show', :constraints => { :id => /^[1-9]\d*/ }
> >>>
> >
> > The above can easily be fixed by adding a $ after the *.  For example,
> >
> > /^[1-9]\d*$/
> >
>
> Why do you continue to claim that you can use anchors in a constraint?
>

In regards to Rails routing, the start anchor ^ is implied as stated in
section
3.8 of the routing documentation.


> Do you even know what an anchor is?
>
>

> > The x after the final / isn't needed being that the begin and end tokens
> > take care of that for you.
>
> Apparently, you don't know what regex flags do either.
>
>
You're using the x flag because you have implemented your RegEx across
several lines
where the spaces are not escaped.  However, one could have easily written
the same thing
in a single line and zero unescaped spaces.  In short, this is just another
way to do the same
thing.

-Conrad


>
> >  Also, you can do all this in the context of
> > a routes.rb using the constrains option to match.
>
> No.  You cannot.
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to