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.74 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.73 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.72 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.71 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.66 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.65 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
activeadmin-0.6.0 lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.64 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.63 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.62 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.61 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.60 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.59 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.58 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.57 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.56 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.50 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.46 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb