class IRuby::Input::Field

Public Instance Methods

widget_html() click to toggle source
# 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}",
      value: @default
    )
  end
end
widget_js() click to toggle source
# File lib/iruby/input/field.rb, line 11
      def widget_js
        <<-JS
          $('.iruby-field').keyup(function() {
            $(this).data('iruby-value', $(this).val());
          });
        JS
      end