Add constraint to route to exclude certain keyword
ruby-on-rails, ruby-on-rails-3
Solution
(?!.*?incident).*
might be what you want.
This is basically the same question as How to negate specific word in regex?. Go there for a more detailed answer.
Problem
I am using Rails and I want to use contraint in route to exclude that route if keyword "incident" is anywhere in the url. I am using rails3. Here is my existing routes. ``` match ':arg', :to => "devices#show", :constraints => {:arg => /???/} ``` I need to put something in constraints so that it does not match if word "incident" is there. Thanks