josevalim/active_model_serializers — pull request #61 by vanstee (2012-05-17 01:14:57+00:00)
Title: Include url helpers in serializers

We needed to generate urls to include hypermedia type links. Here's an example.

```ruby
class Post < ActiveRecord::Base
end

class PostSerializer < ActiveModel::Serializer
def attributes
hash = super
hash[:links] = [
{ :rel => 'self', :href => post_url(post) }
]
hash
end
end
```