# Do not pass password and password_confirmation in json, because update action json.array! @users do |user|

json.extract! user, :id, :email, :created_at, :updated_at, :first_service
if user.profile
    json.profile_attributes do
        json.extract! user.profile, :id, :company_name, :tel, :mobile, :fax, :address, :created_at, :updated_at
    end
end

json.services do
    json.array! user.services do |service|
        json.extract! service, :id, :name, :description, :created_at, :updated_at
    end
end

end