Sha256: e452d5be09b82ec2f78ff73cad45b669e321ddb38ebec393b835f01d26b33ee9

Contents?: true

Size: 563 Bytes

Versions: 10

Compression:

Stored size: 563 Bytes

Contents

module Para
  module OrderingHelper
    def reorder_anchor(options = {})
      options[:class] ||= ''
      options[:class] = [options[:class], 'order-anchor'].join(' ')

      field = if (form = options.delete(:form))
        form.hidden_field(:position, class: 'resource-position-field')
      else
        value = options.delete(:value) || 0
        hidden_field_tag(:position, value, class: 'resource-position-field')
      end

      content_tag(:span, options) do
        content_tag(:i, '', class: 'fa fa-bars') +
        field
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
para-0.6.9 app/helpers/para/ordering_helper.rb
para-0.6.8 app/helpers/para/ordering_helper.rb
para-0.6.7 app/helpers/para/ordering_helper.rb
para-0.6.3 app/helpers/para/ordering_helper.rb
para-0.6.2 app/helpers/para/ordering_helper.rb
para-0.5.4 app/helpers/para/ordering_helper.rb
para-0.5.3 app/helpers/para/ordering_helper.rb
para-0.5.1 app/helpers/para/ordering_helper.rb
para-0.5.0 app/helpers/para/ordering_helper.rb
para-0.4.0 app/helpers/para/ordering_helper.rb