summaryrefslogtreecommitdiff
path: root/app/controllers/my
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-05-28 22:17:59 -0600
committermo khan <mo@mokhan.ca>2014-05-28 22:17:59 -0600
commitb812aa50a640066aac2f5f018482e167bed51e69 (patch)
treea950b38dffd69c7772c78e7ba51d167eb60de280 /app/controllers/my
parent25693b068df372fd4d25d85e8f6ff545aaa4adc7 (diff)
switch to new hash syntax.
Diffstat (limited to 'app/controllers/my')
-rw-r--r--app/controllers/my/photos_controller.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/app/controllers/my/photos_controller.rb b/app/controllers/my/photos_controller.rb
index 96fe8934..52069803 100644
--- a/app/controllers/my/photos_controller.rb
+++ b/app/controllers/my/photos_controller.rb
@@ -24,9 +24,9 @@ module My
@photo = @cake.photos.build(attributes)
if @photo.save
- render :json => {files: [@mapper.map_from(@photo)]}.to_json
+ render json: { files: [@mapper.map_from(@photo)] }
else
- render :json => [{:error => "oops... we're sorry but we weren't able to upload your photo."}], :status => 304
+ render json: [ { error: "oops... we're sorry but we weren't able to upload your photo." } ], status: 304
end
end
@@ -34,9 +34,9 @@ module My
@photo = @cake.photos.find(params[:id])
if @photo.destroy
@cake.touch
- render :json => {files: [@mapper.map_from(@photo)]}.to_json
+ render json: { files: [@mapper.map_from(@photo)] }
else
- render :json => [{:error => "could not remove the photo"}], :status => 304
+ render json: [ { error: "could not remove the photo" } ], status: 304
end
end
@@ -56,11 +56,11 @@ end
class PhotoToJQJsonMapper
def map_from(photo)
{
- :name => photo.read_attribute(:image),
- :url => photo.image.url,
- :thumbnail_url => photo.is_processed? ? photo.image.thumb.url : photo.image.thumb.default_url,
- :delete_url => photo.id,
- :delete_type => "DELETE"
+ name: photo.read_attribute(:image),
+ url: photo.image.url,
+ thumbnail_url: photo.is_processed? ? photo.image.thumb.url : photo.image.thumb.default_url,
+ delete_url: photo.id,
+ delete_type: "DELETE"
}
end
end