Skip to content

Instantly share code, notes, and snippets.

Created May 21, 2015 10:16
Show Gist options
  • Save anonymous/842d17be19f02a060847 to your computer and use it in GitHub Desktop.
Save anonymous/842d17be19f02a060847 to your computer and use it in GitHub Desktop.
UserPresenter
class V1::UsersPresenter
def initialize(users)
@users = users
end
def as_json(*)
@per_page.to_json
@users.to_json(only: [:location, :name, :type, :location_description, :address], include: { location: { only: :coordinates }, address: { only: :street}})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment