Created
June 3, 2012 19:12
-
-
Save bhserna/2864681 to your computer and use it in GitHub Desktop.
Your api in your views
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= content_tag "div", class: "milestones", | |
data: { | |
milestones: render(template: "api/v1/milestones/index.json") | |
} do %> | |
<%= javascript_tag do %> | |
jQuery(function(){ | |
App.init(); | |
}); | |
<% end %> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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