Resting Pug logo Resting Pug

Description

Returns an array with all fields that API will allow to use while sorting subjects

Tip

Override this method to add or remove fields that you don’t want API to use for sorting.

Used in

Use

Example

class BooksController < ApplicationController
  include RestingPug::Base

  private
  # Override a permitted_fields_for_sort method to use every permitted attribute except :title
  def permitted_fields_for_sort
    permitted_fields - [:title]
  end
end

Source code

# lib/resting_pug/params.rb

def permitted_fields_for_sort
  permitted_fields
end
Find me on GitHub