Sha256: bf8b55f2393a1a2dd786d113c1ccb53e311aafe508c5fb000dda68bbf22a536d

Contents?: true

Size: 542 Bytes

Versions: 13

Compression:

Stored size: 542 Bytes

Contents

# frozen_string_literal: true

require_relative '../params/current_helper'
require_relative './next_direction_for_helper'

module Sort
  module PathForHelper
    include Params::CurrentHelper
    include Sort::NextDirectionForHelper

    def sort_path_for(attribute)
      url_for sort_params_for(attribute)
    end

    private

    def sort_params_for(attribute)
      current_params
        .merge(only_path: true,
               sort: {
                 attribute => next_sort_direction_for(attribute)
               })
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
actionset-0.11.0 lib/action_set/helpers/sort/path_for_helper.rb
actionset-0.10.0 lib/action_set/helpers/sort/path_for_helper.rb
actionset-0.9.2 lib/action_set/helpers/sort/path_for_helper.rb
actionset-0.9.1 lib/action_set/helpers/sort/path_for_helper.rb
actionset-0.8.2 lib/action_set/helpers/sort/path_for_helper.rb
actionset-0.8.1 lib/action_set/helpers/sort/path_for_helper.rb
actionset-0.8.0 lib/action_set/helpers/sort/path_for_helper.rb
actionset-0.7.0 lib/action_set/helpers/sort/path_for_helper.rb
actionset-0.6.0 lib/action_set/helpers/sort/path_for_helper.rb
actionset-0.5.4 lib/action_set/helpers/sort/path_for_helper.rb
actionset-0.5.3 lib/action_set/helpers/sort/path_for_helper.rb
actionset-0.5.2 lib/action_set/helpers/sort/path_for_helper.rb
actionset-0.5.1 lib/action_set/helpers/sort/path_for_helper.rb