Resting Pug logo Resting Pug

Description

Returns an array with all fields that API will allow to use while updating a subject

Tip

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

Used in

Use

Example

class BooksController < ApplicationController
  include RestingPug::Base

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

Source code

# lib/resting_pug/params.rb

def permitted_fields_for_update
  permitted_fields - [:id, :created_at, :updated_at]
end
Find me on GitHub