Method: ActionDispatch::Routing::Mapper::Concerns#concerns
- Defined in:
- actionpack/lib/action_dispatch/routing/mapper.rb
#concerns(*args) ⇒ Object
Use the named concerns
resources :posts do
concerns :commentable
end
Concerns also work in any routes helper that you want to use:
namespace :posts do
concerns :commentable
end
2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 |
# File 'actionpack/lib/action_dispatch/routing/mapper.rb', line 2132 def concerns(*args) = args. args.flatten.each do |name| if concern = @concerns[name] concern.call(self, ) else raise ArgumentError, "No concern named #{name} was found!" end end end |