Type:
Module

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
concern

concern(name, callable = nil, &block) Instance Public methods Define a routing

2015-06-20 00:00:00
concerns

concerns(*args) Instance Public methods Use the named concerns

2015-06-20 00:00:00