Sha256: 29f70ffe3250bb167a68dbfe444ed6519ba98015a7a765f27962e2f4b9214b48

Contents?: true

Size: 708 Bytes

Versions: 113

Compression:

Stored size: 708 Bytes

Contents

# frozen_string_literal: true

module Effective
  module FormInputs
    class Delete < Submit

      def build_input(&block)
        tags = [
          icon('check', style: 'display: none;'),
          icon('x', style: 'display: none;'),
          icon('spinner'),
          (block_given? ? capture(&block) : content_tag(:a, name, options[:input]))
        ]

        (left? ? tags.reverse.join : tags.join).html_safe
      end

      def input_html_options
        {
          class: 'btn btn-warning',
          id: tag_id,
          data: { method: :delete, remote: true, confirm: "Really delete<br>#{object}?".html_safe }
        }
      end

      def border?
        false
      end

    end
  end
end

Version data entries

113 entries across 113 versions & 1 rubygems

Version Path
effective_bootstrap-1.19.10 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.19.9 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.19.8 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.19.7 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.19.6 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.19.5 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.19.4 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.19.3 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.19.2 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.19.1 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.19.0 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.18.7 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.18.4 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.18.3 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.18.2 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.18.1 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.18.0 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.17.6 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.17.5 app/models/effective/form_inputs/delete.rb
effective_bootstrap-1.17.4 app/models/effective/form_inputs/delete.rb