Method: Manageable::Helpers::FormBuilder#button

Defined in:
lib/manageable/helpers/form_builder.rb

#button(value = nil, options = {}) ⇒ Object

Generates an activo compliant submit button



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/manageable/helpers/form_builder.rb', line 18

def button(value=nil, options={})
  value, options = nil, value if value.is_a?(Hash)

  value         ||= I18n.t("manageable.save")
  options[:class] = [options[:class], "button"].compact.join(" ")
  image           = @template.image_tag(options.delete(:image) || "/assets/manageable/icons/tick.png", :alt => value)

  @template.button_tag(options) do
    [image, value].compact.join(" ").html_safe
  end
end