public Method

InstanceTag.to_radio_button_tag(tag_value, options = {})

There's no documentation for this item.

Source Code

# File action_view/helpers/form_helper.rb, line 489
def to_radio_button_tag(tag_value, options = {})
  options = DEFAULT_RADIO_OPTIONS.merge(options.stringify_keys)
  options["type"]     = "radio"
  options["value"]    = tag_value
  if options.has_key?("checked")
    cv = options.delete "checked"
    checked = cv == true || cv == "checked"
  else
    checked = self.class.radio_button_checked?(value(object), tag_value)
  end
  options["checked"]  = "checked" if checked
  pretty_tag_value    = tag_value.to_s.gsub(/\s/, "_").gsub(/\W/, "").downcase
  options["id"]     ||= defined?(@auto_index) ?
    "#{@object_name}_#{@auto_index}_#{@method_name}_#{pretty_tag_value}" :
    "#{@object_name}_#{@method_name}_#{pretty_tag_value}"
  add_default_name_and_id(options)
  tag("input", options)
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.