Module: ActionView::Helpers::Tags::Checkable

Included in:
CheckBox, RadioButton
Defined in:
lib/action_view/helpers/tags/checkable.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#input_checked?(object, options) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
9
10
11
12
# File 'lib/action_view/helpers/tags/checkable.rb', line 5

def input_checked?(object, options)
  if options.has_key?("checked")
    checked = options.delete "checked"
    checked == true || checked == "checked"
  else
    checked?(value(object))
  end
end