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
activeadmin-0.6.6 lib/active_admin/batch_actions/views/batch_action_form.rb
activeadmin-0.6.5 lib/active_admin/batch_actions/views/batch_action_form.rb
activeadmin-0.6.4 lib/active_admin/batch_actions/views/batch_action_form.rb
yousty-activeadmin-1.0.4.pre lib/active_admin/batch_actions/views/batch_action_form.rb
yousty-activeadmin-1.0.3.pre lib/active_admin/batch_actions/views/batch_action_form.rb
yousty-activeadmin-1.0.2.pre lib/active_admin/batch_actions/views/batch_action_form.rb
activeadmin-0.6.3 lib/active_admin/batch_actions/views/batch_action_form.rb
yousty-activeadmin-1.0.1.pre lib/active_admin/batch_actions/views/batch_action_form.rb
yousty-activeadmin-1.0.0.pre lib/active_admin/batch_actions/views/batch_action_form.rb
activeadmin-0.6.2 lib/active_admin/batch_actions/views/batch_action_form.rb
activeadmin-0.6.1 lib/active_admin/batch_actions/views/batch_action_form.rb
aa-rails4-0.6.0 lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.141 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.136 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.135 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.134 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.133 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.132 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.131 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb
lalala-4.0.0.dev.129 vendor/deps/active_admin/lib/active_admin/batch_actions/views/batch_action_form.rb