I have try to watch as many videos as possible but lot of them where not interesting
Drifting Ruby
class ApplicationSerializer < ActiveModel::Serializer include Rails.application.routes.url_helpers default_url_options[:host] = 'api.demo.dev' end class UserSerializer < ApplicationSerializer attributes :id, :first_name, :last_name, :show attribute :email, if: :current_user attribute :edit_link, if: :current_user_is_owner has_many :phones def show UsersController.render(:show, assigns: { user: object}, layout: false ).squish end def edit_link edit_user_url(object) end def current_user_is_owner scope == object end end class PhoneSerializer < ApplicationSerializer attributes :name, :phone_number end