public Method

FormHelper.apply_form_for_options!(object_or_array, options)

There's no documentation for this item.

Source Code

# File action_view/helpers/form_helper.rb, line 207
def apply_form_for_options!(object_or_array, options) #:nodoc:
  object = object_or_array.is_a?(Array) ? object_or_array.last : object_or_array

  html_options =
    if object.respond_to?(:new_record?) && object.new_record?
      { :class  => dom_class(object, :new),  :id => dom_id(object), :method => :post }
    else
      { :class  => dom_class(object, :edit), :id => dom_id(object, :edit), :method => :put }
    end

  options[:html] ||= {}
  options[:html].reverse_merge!(html_options)
  options[:url] ||= polymorphic_path(object_or_array)
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.