Displaying 3 results from an estimated 3 matches for "nesquena".
Did you mean:
esquema
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
2010 Aug 16
2
Form validation and processing w/o model (no Db/ActiveRecord)
...ts.
All am looking to do is receive and validate form input, and ideally have
the luxuries like Class.new(params[:object]),
Class.update_attributes(params[:object]), and for the form to do similar
highlighting and error feedback messages as AR.
I found this plug-in: active_form (http://github.com/nesquena/active_form).
Wondering if anyone has used or has better ideas.
David
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To uns...
2012 Sep 18
4
"best practices" for Rails serving RESTful JSON services for use by AngularJS, Ember.js, etc.
...internal_server_error, etc.), then there is location url which
I''m not sure if has a place in a service meant for consumption by a service
meant to be consumed by a javascript app?, etc. For an idea of the various
things that people have to do and what they run into:
https://github.com/nesquena/rabl/issues/88
http://forums.pragprog.com/forums/191/topics/8247
https://github.com/rails/rails/issues/2798
etc.
So you maybe end up with something like this just to handle a POST:
# this makes sense for Rails served view, as a failed create, but does it
makes sense in a JSON service-oriented...