2012-03-04 54 views

回答

1

相关联的模型和属性-可选的,需要被传递到JSON在控制器:

post.to_json(:include => :user => {:only => :username }) 

参见to_json (apidock)

相关问题