Skip to content

Instantly share code, notes, and snippets.

@nathanjsharpe
Created September 17, 2013 20:51
Show Gist options
  • Save nathanjsharpe/6600458 to your computer and use it in GitHub Desktop.
Save nathanjsharpe/6600458 to your computer and use it in GitHub Desktop.
rather than specify the association using has_one or belongs_to, you can define it yourself
class PlaceSerializer < ActiveModel::Serializer
attributes :id, :foo, :bar, :features
def features
feature
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment