Flowdock
method

action_options_for

Importance_0
Ruby on Rails latest stable (v4.0.2) - 0 notes - Class: ActionController::Resources

Method deprecated or moved

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

action_options_for(action, resource, method = nil, resource_options = {}) 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_controller/resources.rb, line 667
      def action_options_for(action, resource, method = nil, resource_options = {})
        default_options = { :action => action.to_s }
        require_id = !resource.kind_of?(SingletonResource)
        force_id = resource_options[:force_id] && !resource.kind_of?(SingletonResource)

        case default_options[:action]
          when "index", "new"; default_options.merge(add_conditions_for(resource.conditions, method || :get)).merge(resource.requirements)
          when "create";       default_options.merge(add_conditions_for(resource.conditions, method || :post)).merge(resource.requirements)
          when "show", "edit"; default_options.merge(add_conditions_for(resource.conditions, method || :get)).merge(resource.requirements(require_id))
          when "update";       default_options.merge(add_conditions_for(resource.conditions, method || :put)).merge(resource.requirements(require_id))
          when "destroy";      default_options.merge(add_conditions_for(resource.conditions, method || :delete)).merge(resource.requirements(require_id))
          else                 default_options.merge(add_conditions_for(resource.conditions, method)).merge(resource.requirements(force_id))
        end
      end
Register or log in to add new notes.