Displaying 4 results from an estimated 4 matches for "restful_json".
2012 Oct 01
1
active_model_serializers, more than one level deep of associations, specifying serializers per association
...alizers), strong_parameters,
and the "permitter" strategy that Adam Hawkins is using:
http://broadcastingadam.com/2012/07/parameter_authorization_in_rails_apis/
Code so far is here (in the integrate-twinturbo_strategy_for_param_authr
branch if you clone):
https://github.com/garysweaver/restful_json/tree/integrate-twinturbo_strategy_for_param_authr
Autogenerated serializer and permitter classes for each model that has a
table (~270 permitters, ~270 serializers), which means a lot of attribute
and association name duplication, but it''s what I''ve got for now.
Running into s...
2012 Sep 28
1
How to Include Associations in #as_json
Hi,
Does anyone know how to include nested associations when overriding a
model''s #as_json method?
Below is my attempt to include direct and nested associations.
NOTE: "office" is a direct association, "company" is nested association
via "office". I''d like both included in the generated json output.
def as_json(options={})
super(:include
2013 Apr 15
4
Rails' scaffold controller generator - should it test json format also?
(Forgive me if this is incorrect, because I recognized this initially as
something in Rails 4.0.0.beta1 and have just done a cursory look over the
latest generator code.)
Noticed in Rails 4 that the test generated for a scaffold controller only
tests the html format instead of both html and json:
2012 Sep 18
4
"best practices" for Rails serving RESTful JSON services for use by AngularJS, Ember.js, etc.
.... in such a way that the user
doesn''t have to tweak a a bunch of rails g controller boilerplate code to
provide services for use in these frameworks that in turn would require
various changes to fit the normal Rails way to specify things.
The gem is here:
https://github.com/garysweaver/restful_json
It needs a heck of a lot of work still, no working tests at the moment, and
integrating roar-rails in its 3.0.0 branch.
Our aim/current strategy for web development is to:
1. Keep # of controllers (and amount of code required for each) to a
minimum, but they shouldn''t be overly monoli...