On Dec 20, 2:55 pm, "pat.osterday" <pat.oster...@gmail.com> wrote:
> Is there any way to use the to_json includes when using
> "render :json"?
>
> I've got this:
>
> format.json { render :json => { :order => @orders } }
>

render :json => @orders.to_json(...)

Fred
> 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.
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to