我嘗試了以下對AJAX響應和它的作品(以HAML):在Ruby on Rails中,如何呈現JSON?
- 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
而不是頂部的前兩行?
任何錯誤訊息? – Danpe 2012-12-29 09:50:05