Skip to content

Instantly share code, notes, and snippets.

@stevencwarren
Created March 27, 2013 16:05
Show Gist options
  • Save stevencwarren/5255433 to your computer and use it in GitHub Desktop.
Save stevencwarren/5255433 to your computer and use it in GitHub Desktop.
class ProjectSerializer < ActiveModel::Serializer
attributes :id, :title, :status, :owner, :description, :created_at, :updated_at, :cover_image_url, :cover_image_thumb_url, :cover_image_show_url
def cover_image_thumb_url
object.cover_image.url(:thumb)
end
def cover_image_show_url
object.cover_image.url(:show)
end
def cover_image_url
object.cover_image.url()
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment