modular_routes
modular_routes copied to clipboard
Pass api mode through options
Sometimes you might have api endpoints being served within the same traditional web app. Having a way of ignoring :edit
and :new
would be nice.
# routes/web.rb
modular_routes do
resources :books
end
# routes/api.rb
modular_routes(api: true) do
resources :books
end