actionpack/lib/action_dispatch/routing/mapper.rb
# 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
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
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
def concerns(*args)
          options = args.extract_options!
          args.flatten.each do |name|
            if concern = @concerns[name]
              concern.call(self, options)
            else
              raise ArgumentError, "No concern named #{name} was found!"
            end
          end
        end
def concerns ( * args ) options = args . extract_options! args . flatten . each do | name | if concern = @concerns [ name ] concern . call ( self , options ) else raise ArgumentError , "No concern named #{name} was found!" end end end
Use the named concerns
resources :posts do
concerns :commentable
end
Use the named concerns resources : posts do concerns : commentable end
args
<not_specific>