Class: AvatarsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/avatars_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



20
21
# File 'app/controllers/avatars_controller.rb', line 20

def destroy
end

#updateObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/avatars_controller.rb', line 7

def update
  if current_avatarable.update_attributes avatarable_params
    respond_to do |format|
      format.html { redirect_to request.referrer || root_path }
      format.json { render json: { redirect_path: request.referrer || root_path } }
    end
  elsif current_avatarable.errors[:logo_crop]
    render json: { crop: render_to_string(partial: 'crop', object: current_avatarable, as: :avatarable) }.to_json
  else
    render json: current_avatarable.errors.to_json
  end
end