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 => [{:office => {:only => [:company, :street, :city, :state, :zip_code]}}]) end Thanks. -Ari -- Posted via http://www.ruby-forum.com/. -- 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 https://groups.google.com/groups/opt_out.