3 ms·
This looks great - I'll be trying it out for a project this week. I'm still searching around for a good solution to API "views" or presenters when I don't want
by tomblomfield 14y ago
This looks great - I'll be trying it out for a project this week.
I'm still searching around for a good solution to API "views" or presenters when I don't want to expose all of a model's attributes. Something like Rabl? What do other people use?
- mihar 14y agoRABL is very good at this.
- steveklabnik2 14y agoThe organization includes ActiveModel::Serializers, which is really important for giving you normalized JavaScript output. Rabl is slow and manual, which is the opposite of the Rails philosophy. Convention over Configuration wins every time.
- tomblomfield 14y agoActiveModel::Serializers is exactly what I was looking for, thanks!
- joecorcoran 14y agoHi Tom, we've been using a combination of responders and Draper decorators for this. It has been in production for almost a year and has worked out pretty well so far. Simon, one of our developers, wrote a couple of articles outlining our API setup: Part 1: http://techblog.tribesports.com/blog/2011/09/24/versioning-the-tribesports-api/ http://techblog.tribesports.com/blog/2011/09/24/versioning-t... Part 2: http://techblog.tribesports.com/blog/2011/09/24/separating-api-logic-with-decorators/ http://techblog.tribesports.com/blog/2011/09/24/separating-a...