Skip to content

Instantly share code, notes, and snippets.

@bhserna
Created June 3, 2012 19:12
Show Gist options
  • Save bhserna/2864681 to your computer and use it in GitHub Desktop.
Save bhserna/2864681 to your computer and use it in GitHub Desktop.
Your api in your views
<%= content_tag "div", class: "milestones",
data: {
milestones: render(template: "api/v1/milestones/index.json")
} do %>
<%= javascript_tag do %>
jQuery(function(){
App.init();
});
<% end %>
<% end %>
json.array!(@milestones) do |json, milestone|
json.(milestone, :id, :name, :due_date)
json.tasks milestone.tasks
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment