The regexp you've specified here will match as long as there are at
least two consecutive non-space characters. The only way I can think
of to do what you're looking for would be to add a route preceding
this one which matches any :plan WITH a space, and routes it to an
error page. EG:
map.bad_detail "subscription_plans/:provider/:plan", :action =>
'detail_error', :requirements => { :plan => /[ ]/ }
map.detail "subscription_plans/:provider/:plan", :action => 'detail'
--Matt Jones
On Sep 23, 3:48 am, harm <[email protected]> wrote:
> Hi!
>
> Consider the following route:
> map.detail "subscription_plans/:provider/:plan", :action =>
> "detail", :requirements => {:plan => /[^ ]+/}
>
> I want this route to match any string _without_ a space character. So
> "Telfort-100" matches "Telfort 100" does not.
>
> I believed this to be correct but it's not. Including anchors ('\A'
> '$' etc) is not allowed. How else can I fix this?
>
> Harm
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---