Skip to content

Instantly share code, notes, and snippets.

@mrpunkin
Created July 13, 2012 00:48
Show Gist options
  • Save mrpunkin/3102076 to your computer and use it in GitHub Desktop.
Save mrpunkin/3102076 to your computer and use it in GitHub Desktop.
def profile_url
Rails.application.routes.url_helpers.user_url(self, :host=>project.domain)
end
def as_json(options={})
super({
:only=>[:first_name, :last_name],
:methods=>[:profile_url]
}.merge(options))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment