Class: AvatarsController

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

Instance Method Summary collapse

Instance Method Details

#cropObject



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

def crop
end

#showObject



4
5
# File 'app/controllers/avatars_controller.rb', line 4

def show
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 @user.update_attributes(params[:user])
    if params[:user][:avatar].blank?
      redirect_to avatar_url
    else
      redirect_to crop_avatar_url
    end
  else
    flash.now.alert = "Invalid image format"
    render :show
  end
end