Class: ProfilesController

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

Instance Method Summary collapse

Instance Method Details

#editObject



10
11
# File 'app/controllers/profiles_controller.rb', line 10

def edit
end

#historyObject



26
27
28
# File 'app/controllers/profiles_controller.rb', line 26

def history
  @activities = doer.activities.by_recent
end

#showObject



7
8
# File 'app/controllers/profiles_controller.rb', line 7

def show
end

#updateObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/profiles_controller.rb', line 13

def update
  if @profile.update_attributes(profile_params)
    if params[:profile][:portrait].present?
      render :crop  ## Render the view for cropping
    else
      Activity.create doer_id: current_user.id, message: "performed a profile edit. See #{view_context.link_to 'public profile', member_path(@profile)}."
      redirect_to profile_path, notice: "<strong><span class=\"glyphicon glyphicon-ok-sign\"></span>&nbsp;&nbsp;Success!</strong> Your profile was updated."
    end
  else
    render action: "edit", warning: "<strong>Attention!</strong> A problem occurred while trying to update your profile. Plese try again."
  end
end