【发布时间】:2010-07-29 21:51:28
【问题描述】:
我尝试了以下方法来响应 AJAX,它可以正常工作(在 HAML 中):
- response.content_type = "application/json"
= render :text => array_data.to_json
但是
- response.content_type = "application/json"
= render :json => array_data.to_json
不起作用。我以为我可以使用
= render :text => array_data.to_json
而不是顶部的前 2 行?
【问题讨论】:
标签: ruby-on-rails json view render