Sha256: 3b9ab1f24c099206b9372f345607a55f6947b778964d48e6a0c646e97d2a31f1

Contents?: true

Size: 610 Bytes

Versions: 10

Compression:

Stored size: 610 Bytes

Contents

module Alchemy
  module Forms
    class Builder < SimpleForm::FormBuilder
      # Renders a simple_form input, but uses input alchemy_wrapper
      #
      def input(attribute_name, options = {}, &block)
        options[:wrapper] = :alchemy
        super
      end

      # Renders a button tag wrapped in a div with 'submit' class.
      #
      def submit(label, options = {})
        options = {class: 'submit'}.update(options[:wrapper_html] || {})
        template.content_tag('div', options) do
          template.content_tag('button', label, options[:input_html])
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
alchemy_cms-3.4.2 lib/alchemy/forms/builder.rb
alchemy_cms-3.4.1 lib/alchemy/forms/builder.rb
alchemy_cms-3.3.3 lib/alchemy/forms/builder.rb
alchemy_cms-3.3.2 lib/alchemy/forms/builder.rb
alchemy_cms-3.4.0 lib/alchemy/forms/builder.rb
alchemy_cms-3.4.0.rc1 lib/alchemy/forms/builder.rb
alchemy_cms-3.3.1 lib/alchemy/forms/builder.rb
alchemy_cms-3.3.0 lib/alchemy/forms/builder.rb
alchemy_cms-3.3.0.rc2 lib/alchemy/forms/builder.rb
alchemy_cms-3.3.0.rc1 lib/alchemy/forms/builder.rb