method
action_options_for
action_options_for(action, resource, method = nil)
private
Hide source
# File actionpack/lib/action_controller/resources.rb, line 475 def action_options_for(action, resource, method = nil) default_options = { :action => action.to_s } require_id = resource.kind_of?(SingletonResource) ? {} : { :requirements => { :id => Regexp.new("[^#{Routing::SEPARATORS.join}]+") } } case default_options[:action] when "index", "new" : default_options.merge(conditions_for(method || :get)) when "create" : default_options.merge(conditions_for(method || :post)) when "show", "edit" : default_options.merge(conditions_for(method || :get)).merge(require_id) when "update" : default_options.merge(conditions_for(method || :put)).merge(require_id) when "destroy" : default_options.merge(conditions_for(method || :delete)).merge(require_id) else default_options.merge(conditions_for(method)) end end