Sha256: ae2cb829c7e3dd8bc47a21c02c313df2907e2352b6e44a19f356e3d846694c81

Contents?: true

Size: 705 Bytes

Versions: 181

Compression:

Stored size: 705 Bytes

Contents

module Effective
  module FormInputs
    class RemoteLinkTo < 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: '', rel: 'nofollow', data: { method: :post, remote: true, confirm: confirm } }
      end

      def border?
        false
      end

      def confirm
        (options.delete(:confirm) || "#{name} to<br>#{object}?").html_safe
      end

    end
  end
end

Version data entries

181 entries across 181 versions & 1 rubygems

Version Path
effective_bootstrap-0.9.7 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.9.6 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.9.5 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.9.4 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.9.3 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.9.2 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.9.1 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.9.0 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.8.5 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.8.4 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.8.3 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.8.2 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.8.1 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.8.0 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.7.4 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.7.3 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.7.2 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.7.1 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.7.0 app/models/effective/form_inputs/remote_link_to.rb
effective_bootstrap-0.6.31 app/models/effective/form_inputs/remote_link_to.rb