Class: IRuby::Input::Field
Instance Method Summary
collapse
Methods inherited from Label
#widget_label
Methods inherited from Widget
builder, #content, #widget_css, #widget_display, #widget_join
Instance Method Details
19
20
21
22
23
24
25
26
27
|
# File 'lib/iruby/input/field.rb', line 19
def widget_html
widget_label do
input(
type: @type,
:'data-iruby-key' => @key,
class: "form-control #{@js_class}"
)
end
end
|
11
12
13
14
15
16
17
|
# File 'lib/iruby/input/field.rb', line 11
def widget_js
<<-JS
$('.iruby-field').keyup(function() {
$(this).data('iruby-value', $(this).val());
});
JS
end
|