<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Sep-11-2013, at 7:02 AM, Nick Novitski <<a href="mailto:nicknovitski@gmail.com">nicknovitski@gmail.com</a>> wrote:</div><blockquote type="cite"><div dir="ltr" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">There's also<span class="Apple-converted-space"> </span><a href="https://github.com/rails-api/active_model_serializers">https://github.com/rails-api/active_model_serializers</a> </div></blockquote></div><div><br></div>+1 on Active Model Serializer.<div><br></div><div>Benefits:</div><div>1) Easily testable, and OO</div><div>2) Has access to current_user (or any other controller method via `scope'). This makes it possible for you to serialize based on who has requested the object</div><div>3) Works seamlessly with respond_with </div><div>4) If you have the same relation object multiple times on your object (say user can be created_by, updated_by, etc…) then you have a way to just `embed' the user once.</div><div><br></div><div>Also, +1 on rails-api gem as well :-)</div><div><div apple-content-edited="true">
--<br>Tejas Dinkar<br><a href="http://www.nilenso.com">http://www.nilenso.com</a><br>Nilenso Software (formerly C42 Engineering)<br>
</div>
<br></div></body></html>