Created
August 31, 2015 21:54
-
-
Save cmaxw/68a882f117ee7a6043e8 to your computer and use it in GitHub Desktop.
013 RailsClips JBuilder
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.name task.name | |
json.due_at task.due_at.strftime("%Y-%m-%d") |
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! @projects do |project| | |
json.name project.name | |
json.created_at project.created_at.strftime("%d/%m/%Y %H:%M") | |
json.tasks project.tasks, :name, :due_at | |
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.name @project.name | |
json.created_at @project.created_at.strftime("%Y-%m-%d %H:%M") | |
json.tasks @project.tasks do |task| | |
json.name task.name | |
json.due_at task.due_at.strftime("%Y-%m-%d") | |
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.name @project.name | |
json.created_at @project.created_at.strftime("%Y-%m-%d %H:%M") | |
json.tasks @project.tasks, partial: 'api/tasks/task', as: :task |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment