module
ActionDispatch::Routing::Mapper::Mapping::Scoping::Concerns
v8.0.0 -
Show latest stable
Routing Concerns allow you to declare common routes that can be reused inside others resources and routes.
concern :commentable do resources :comments end concern :image_attachable do resources :images, only: :index end
These concerns are used in Resources routing:
resources :messages, concerns: [:commentable, :image_attachable]
or in a scope or namespace:
namespace :posts do concerns :commentable end
Files
- actionpack/lib/action_dispatch/routing/mapper.rb