It\'s a pain to write codes like this all the time in jbuilder.json template:
json.extract! notification, :id, :user_id, :notice_type, :message, :resource_ty
In case if you want to exclude any of the attributes. Ex: created_at and updated_at
created_at
updated_at
json.merge! notification.attributes.reject{ |key, _| key.in?(['created_at', 'updated_at']) }