Class: AbAdmin::Views::Inputs::ColorInput

Inherits:
SimpleForm::Inputs::Base
  • Object
show all
Defined in:
lib/ab_admin/views/inputs/color_input.rb

Instance Method Summary collapse

Instance Method Details

#inputObject



5
6
7
8
9
# File 'lib/ab_admin/views/inputs/color_input.rb', line 5

def input
  value = @builder.object[attribute_name].to_s.sub(/^#|/, '#')
  name = "#{@builder.object_name}[#{attribute_name}]"
  @builder.template.tag(:input, input_html_options.merge(:type => 'color', :name => name, :value => value))
end