diff options
| author | mo khan <mo@mokhan.ca> | 2014-07-05 23:10:12 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-07-05 23:10:12 -0600 |
| commit | e8788db6985d944445027dd4a686ff8d49e2c742 (patch) | |
| tree | 3a06945dfc9338b94203ab9d84277aeda2e65cb9 /app/assets/javascripts/backbone/controllers | |
| parent | 58e49cf1034e220a518425a7a8c8bd9fd77503ae (diff) | |
extract photos controller from the photos router.
Diffstat (limited to 'app/assets/javascripts/backbone/controllers')
| -rw-r--r-- | app/assets/javascripts/backbone/controllers/photos_controller.js.coffee | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/assets/javascripts/backbone/controllers/photos_controller.js.coffee b/app/assets/javascripts/backbone/controllers/photos_controller.js.coffee new file mode 100644 index 00000000..15e08585 --- /dev/null +++ b/app/assets/javascripts/backbone/controllers/photos_controller.js.coffee @@ -0,0 +1,13 @@ +class CakeSide.Controllers.PhotosController + show: (cake_id, id) -> + @photos = CakeSide.Application.request('PhotosRepository', cake_id) + photo = new CakeSide.Models.Photo({cake_id: cake_id, id: id}) + photo.fetch() + cake = CakeSide.Application.request('CakesRepository').get(cake_id) + @view = new CakeSide.Views.Photos.ShowView(model: photo, collection: @photos) + CakeSide.Application.content_region.show(@view) + CakeSide.Application.request('CommentView').render + identifier: "c-#{cake_id}" + title: cake.get('name') + url: cake.public_url() + |
