Sha256: d68bef6cd289e35a519bd991f86cd6b5d84214692529c93a4283e399986e6390

Contents?: true

Size: 677 Bytes

Versions: 54

Compression:

Stored size: 677 Bytes

Contents

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

54 entries across 54 versions & 1 rubygems

Version Path
effective_bootstrap-0.9.7 app/models/effective/form_inputs/delete.rb
effective_bootstrap-0.9.6 app/models/effective/form_inputs/delete.rb
effective_bootstrap-0.9.5 app/models/effective/form_inputs/delete.rb
effective_bootstrap-0.9.4 app/models/effective/form_inputs/delete.rb
effective_bootstrap-0.9.3 app/models/effective/form_inputs/delete.rb
effective_bootstrap-0.9.2 app/models/effective/form_inputs/delete.rb
effective_bootstrap-0.9.1 app/models/effective/form_inputs/delete.rb
effective_bootstrap-0.9.0 app/models/effective/form_inputs/delete.rb
effective_bootstrap-0.8.5 app/models/effective/form_inputs/delete.rb
effective_bootstrap-0.8.4 app/models/effective/form_inputs/delete.rb
effective_bootstrap-0.8.3 app/models/effective/form_inputs/delete.rb
effective_bootstrap-0.8.2 app/models/effective/form_inputs/delete.rb
effective_bootstrap-0.8.1 app/models/effective/form_inputs/delete.rb
effective_bootstrap-0.8.0 app/models/effective/form_inputs/delete.rb