J'ai essayé ce qui suit pour répondre à AJAX et il fonctionne (en HAML):Dans Ruby on Rails, comment rendre JSON?
- response.content_type = "application/json"
= render :text => array_data.to_json
mais
- response.content_type = "application/json"
= render :json => array_data.to_json
ne fonctionne pas. Je pensais que je pouvais utiliser
= render :text => array_data.to_json
au lieu des 2 premières lignes en haut?
Tout message d'erreur? – Danpe