Resting Pug logo Resting Pug

Description

Returns an array with all fields that API will show

Tip

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

Used in

Use

Example

class BooksController < ApplicationController
  include RestingPug::Base

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

Source code

# lib/resting_pug/params.rb

def permitted_fields_for_show
  permitted_fields
end
Find me on GitHub