diff options
| author | mo khan <mo@mokhan.ca> | 2014-11-22 09:09:53 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-11-22 09:09:53 -0700 |
| commit | 4454bd91253ae68108ddc5f79d73b544e6c8a524 (patch) | |
| tree | adb5c749b7b0860c6208dc9b0889286ec6142f0f /app/views/api | |
| parent | 44c11c4d9cc2a0e0d5e11c2abe5682d23875e656 (diff) | |
move tutorial to json partial.
Diffstat (limited to 'app/views/api')
| -rw-r--r-- | app/views/api/v2/tutorials/_tutorial.json.jbuilder | 7 | ||||
| -rw-r--r-- | app/views/api/v2/tutorials/index.json.jbuilder | 6 |
2 files changed, 8 insertions, 5 deletions
diff --git a/app/views/api/v2/tutorials/_tutorial.json.jbuilder b/app/views/api/v2/tutorials/_tutorial.json.jbuilder new file mode 100644 index 00000000..c467e5e4 --- /dev/null +++ b/app/views/api/v2/tutorials/_tutorial.json.jbuilder @@ -0,0 +1,7 @@ +json.cache! ['v2', tutorial] do + json.heading tutorial.heading + json.description tutorial.description + json.url tutorial.url + json.image_url tutorial.image_url + json.submitter tutorial.user.id +end diff --git a/app/views/api/v2/tutorials/index.json.jbuilder b/app/views/api/v2/tutorials/index.json.jbuilder index b9e7ee36..6079a7db 100644 --- a/app/views/api/v2/tutorials/index.json.jbuilder +++ b/app/views/api/v2/tutorials/index.json.jbuilder @@ -1,7 +1,3 @@ json.tutorials @tutorials do |tutorial| - json.heading tutorial.heading - json.description tutorial.description - json.url tutorial.url - json.image_url tutorial.image_url - json.submitter tutorial.user.id + json.partial! tutorial, tutorial: tutorial end |
