Returning different represenations of the same resource based on some condition in API

9 views
Skip to first unread message

Szymon Nowak

unread,
Jul 13, 2011, 11:19:04 AM7/13/11
to rubyonra...@googlegroups.com
Hey,

I was wondering if anybody has it all figured out :) 

Basically I need something similar that Facebook or Twitter are doing in their API - if you make an unauthorized request for a resource you get back a "public" representation of it, if you make an authorized one you get "private/full" representation. It would be awesome if it could be integrated somehow into a responder...

Cheers,
Szymon

Tim Shaffer

unread,
Jul 13, 2011, 12:43:10 PM7/13/11
to rubyonra...@googlegroups.com
I haven't used it, but maybe checkout the acts_as_api gem.

https://github.com/fabrik42/acts_as_api

Szymon Nowak

unread,
Jul 13, 2011, 1:08:00 PM7/13/11
to rubyonra...@googlegroups.com
Thanks! Looks like it's exactly what I need.
Reply all
Reply to author
Forward
0 new messages