svenfuchs / routing-filter

routing-filter wraps around the complex beast that the Rails routing system is, allowing for unseen flexibility and power in Rails URL recognition and generation.
http://www.artweb-design.de
MIT License
464 stars 84 forks source link

How to use filter in a block? #62

Open phlegx opened 8 years ago

phlegx commented 8 years ago

Hi! I want to use filter in routes.rb in a block, so that I can filter only for some routes the locale:

Rails.application.routes.draw do
  filter :locale do
    get '/home', ...
    get '/help', ...
  end
end

So, the idea comes from gem _routetranslator where I can do:

Rails.application.routes.draw do
  localized do
    get '/home', ...
    get '/help', ...
  end
end

How can I do that?