Sha256: 35eb30bf56f21c5183acb2b51f85f4447ed871c20e0632ed8908d81538b9c57c

Contents?: true

Size: 772 Bytes

Versions: 58

Compression:

Stored size: 772 Bytes

Contents

require 'active_admin/component'

module ActiveAdmin
  module BatchActions

    # Build an BatchActionForm
    class BatchActionForm < ActiveAdmin::Component
      builder_method :batch_action_form

      attr_reader :prefix_html

      def build(options = {}, &block)
        options[:id] ||= "collection_selection"

        # Open a form
        text_node form_tag(active_admin_config.batch_action_path(params), :id => options[:id])
        input(:name => :batch_action, :id => :batch_action, :type => :hidden)

        super(options)
      end

      # Override the default to_s to include a closing form tag
      def to_s
        content + closing_form_tag
      end

      private

      def closing_form_tag
        '</form>'.html_safe
      end

    end
  end
end

Version data entries

58 entries across 58 versions & 4 rubygems

Version Path
lalala-4.0.0.dev.128 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.126 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.125 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.124 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.123 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.118 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.116 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.114 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.113 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.111 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.109 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.107 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.94 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.92 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.90 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.84 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.80 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.79 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.78 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.77 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb