Class: AddonInput

Inherits:
SimpleForm::Inputs::StringInput
  • Object
show all
Extended by:
PureAdmin::ApplicationHelper
Defined in:
app/inputs/addon_input.rb

Overview

Overrides the :email input type to add a default prefix.

Direct Known Subclasses

EmailInput, TelInput

Instance Method Summary collapse

Methods included from PureAdmin::ApplicationHelper

merge_html_classes

Instance Method Details

#iconObject



6
7
8
9
10
11
12
# File 'app/inputs/addon_input.rb', line 6

def icon
  if options[:icon].present?
    template.(:span, nil, class: ['input-addon', 'fa', 'fa-fw', options[:icon]])
  else
    ''
  end
end

#input(wrapper_options = nil) ⇒ Object



14
15
16
# File 'app/inputs/addon_input.rb', line 14

def input(wrapper_options = nil)
  icon + super(wrapper_options)
end