But I'd also like to include the address (order.address) association.
The "to_json" method has all these options, but I don't see how I can
use that with render :json. If I tack on the to_json to @orders the
render :json escapes the whole thing. I'm using Ext JS on the client
side.
use eager loading on your @orders with :include option or use :select to
add attributes from address if you only need limited data from address
and performance is a concern.
This works, but what if I want to add other json object that aren't in
orders? Ext JS needs a "count" param for it's client side
pagination. So I originally had this:
This works, but what if I want to add other json object that aren't in
orders? Ext JS needs a "count" param for it's client side
pagination. So I originally had this: