Module: CieloAssets::FormHelper

Defined in:
app/helpers/cielo_assets/form_helper.rb

Instance Method Summary collapse

Instance Method Details

#cielo_controls(object_name, method, options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/helpers/cielo_assets/form_helper.rb', line 3

def cielo_controls object_name, method, options={}
  id    = options.delete(:id)    || :cielo_controls
  style = options.delete(:style) || :horizontal

   :div, id: id, class: style do
    [:amex,:diners,:elo,:mastercard,:mastercard_securecode,:verified_by_visa,:visa].collect { |flag|
      [
        radio_button(object_name, method, flag, options),
        label("#{object_name}_#{method}", flag, options.merge(class: flag))
      ].join.html_safe
    }.join.html_safe
  end
end