Flowdock
method

apply_common_behavior_for

Importance_0
Ruby on Rails latest stable (v6.1.7.7) - 0 notes - Class: Resources

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v6.0.0) is shown here.

These similar methods exist in v6.1.7.7:

apply_common_behavior_for(method, resources, options, &block) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_dispatch/routing/mapper.rb, line 1676
          def apply_common_behavior_for(method, resources, options, &block)
            if resources.length > 1
              resources.each { |r| send(method, r, options, &block) }
              return true
            end

            if options[:shallow]
              options.delete(:shallow)
              shallow do
                send(method, resources.pop, options, &block)
              end
              return true
            end

            if resource_scope?
              nested { send(method, resources.pop, options, &block) }
              return true
            end

            options.keys.each do |k|
              (options[:constraints] ||= {})[k] = options.delete(k) if options[k].is_a?(Regexp)
            end

            scope_options = options.slice!(*RESOURCE_OPTIONS)
            unless scope_options.empty?
              scope(scope_options) do
                send(method, resources.pop, options, &block)
              end
              return true
            end

            false
          end
Register or log in to add new notes.