Class: AccountController

Inherits:
ApplicationController show all
Defined in:
app/controllers/account_controller.rb

Constant Summary

Constants included from PaginationHelper

PaginationHelper::DEFAULT_OPTIONS, PaginationHelper::OPTIONS

Instance Method Summary collapse

Methods included from PaginationHelper

included, #paginate, validate_options!

Instance Method Details

#infoObject



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

def info
  @user = current_user
  if @request.post?
    if valid_user_face?(@params['face']['picture'])
      picture = @user.face || @user.build_face
      picture.picture      = @params['face']['picture'].read
      picture.content_type = @params['face']['picture'].content_type
      picture.save
      # Need to update the headers so the newly updated image is displayed in the browser
      @headers['Last-Modified'] = Time.now
    end
    @user = User.update(@params['id'], @params['user'])
    start_user_session(@user)
  end
end