Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

rails hide field in json

class User < ApplicationRecord
  def as_json(options={})
    options[:except] ||= [:ip]
    super(options)
  end
end
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #rails #hide #field #json
ADD COMMENT
Topic
Name
2+4 =