3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# 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
object = options[:object]
content_tag :div, id: id, class: style do
%w(amex diners elo mastercard mastercard_securecode verified_by_visa visa).collect { |flag|
options.merge! object: object
radio = radio_button object_name, method, flag, options
radio_id = radio.to_s.scan(/id=\"([^"]*)/).flatten.first
label_options = options.merge class: "#{flag} selectable", for: radio_id
[
radio, label(radio_id, flag, label_options)
].join.html_safe
}.join.html_safe
end
end
|