Last active
June 8, 2016 11:16
-
-
Save scaffeinate/7da79f8f463db1ab8f6ef2880cf062ae to your computer and use it in GitHub Desktop.
Rails 5 API user serializer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Api::V1::UserSerializer < ActiveModel::Serializer | |
| attributes :id, :name, :email | |
| def name | |
| "#{object.first_name} #{object.last_name}" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment