REFACTOR: Convert profile background uploader to be an ember component

This commit is contained in:
Robin Ward
2014-06-26 11:43:44 -04:00
parent 06880c28f8
commit 4088fba4f2
16 changed files with 118 additions and 107 deletions

View File

@ -333,12 +333,12 @@ class UsersController < ApplicationController
# LEGACY: used by the API
def upload_avatar
params[:user_image_type] = "avatar"
params[:image_type] = "avatar"
upload_user_image
end
def upload_user_image
params.require(:user_image_type)
params.require(:image_type)
user = fetch_user_from_params
guardian.ensure_can_edit!(user)
@ -353,7 +353,7 @@ class UsersController < ApplicationController
upload = Upload.create_for(user.id, image.file, image.filename, image.filesize)
if upload.errors.empty?
case params[:user_image_type]
case params[:image_type]
when "avatar"
upload_avatar_for(user, upload)
when "profile_background"