Sha256: 3996e2e8b892ecc8114d9d311bc9e39cbced5352e1da0cf06c12b64b77aaf0da

Contents?: true

Size: 612 Bytes

Versions: 27

Compression:

Stored size: 612 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

27 entries across 27 versions & 2 rubygems

Version Path
alchemy_cms-3.2.1 lib/alchemy/forms/builder.rb
alchemy_cms-3.1.3 lib/alchemy/forms/builder.rb
lc_alchemy_cms-3.2.1 lib/alchemy/forms/builder.rb
lc_alchemy_cms-3.2.0 lib/alchemy/forms/builder.rb
alchemy_cms-3.2.0 lib/alchemy/forms/builder.rb
alchemy_cms-3.2.0.rc1 lib/alchemy/forms/builder.rb
alchemy_cms-3.2.0.beta lib/alchemy/forms/builder.rb
alchemy_cms-3.1.1 lib/alchemy/forms/builder.rb
alchemy_cms-3.0.4 lib/alchemy/forms/builder.rb
alchemy_cms-3.1.0 lib/alchemy/forms/builder.rb
alchemy_cms-3.1.0.rc3 lib/alchemy/forms/builder.rb
alchemy_cms-3.1.0.rc2 lib/alchemy/forms/builder.rb
alchemy_cms-3.1.0.rc1 lib/alchemy/forms/builder.rb
alchemy_cms-3.1.0.beta6 lib/alchemy/forms/builder.rb
alchemy_cms-3.1.0.beta5 lib/alchemy/forms/builder.rb
alchemy_cms-3.1.0.beta4 lib/alchemy/forms/builder.rb
alchemy_cms-3.0.3 lib/alchemy/forms/builder.rb
alchemy_cms-3.1.0.beta3 lib/alchemy/forms/builder.rb
alchemy_cms-3.1.0.beta2 lib/alchemy/forms/builder.rb
alchemy_cms-3.1.0.beta1 lib/alchemy/forms/builder.rb