(2) , . (3) , AJAX. (1), , JS, .
JSON JS, Poison.encode!(). @posts, *.html.eex:
<script>
var POSTS = <%= Poison.encode!(@posts) %>;
</script>
JS , POSTS. (, , App.posts = ...:
<script>
var App = window.App || {};
App.posts = <%= Poison.encode!(@posts) %>;
</script>
, @posts , JSON ( ), , .