Hello! Im developing my first rails application =) I have such a code in my routes.rb:
match 'category/:category' => "articles#index", :as => 'articles_from_category'
It's obvious that rails will load anything that comes after /articles/, even a mess route like /articles/dsfjsdfsd. What i want to do is to make rails know that there is only a few path i want it to load (such /articles/science ) and for a mess routes just render 404 page . Im trying to do that using constraints like this:
match 'category/:category' => "articles#index", :as => 'articles_from_category', :constraints => { :category => /"technology"|"science"|"gadgets"|"cosmos"/ }
but it doesn't work. any ideas? I'd really appreciate any help! May be i doesn't need to use constraints at all?