Permalink
Browse files

correcting update mechanism

  • Loading branch information...
1 parent c82548a commit fa2a10517fc61b616ac10d3e638d5c649fe068b4 erik committed Jul 9, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 app/controllers/profiles_controller.rb
@@ -4,15 +4,15 @@ class ProfilesController < ApplicationController
before_filter :get_profile, :except => :ban
def ban
- @profile = User.find(params[:id])
- @profile.update_attributes({:is_banned => true}) if current_user && current_user.is_a?(Admin) && @profile
+ user = User.find(params[:id])
+ user.update_attribute(:is_banned, true) if current_user && current_user.is_a?(Admin) && user
redirect_to :back
return
end
def unban
- @profile = User.find(params[:id])
- @profile.update_attributes({:is_banned => false}) if current_user && current_user.is_a?(Admin) && @profile
+ user = User.find(params[:id])
+ user.update_attributes(:is_banned, false) if current_user && current_user.is_a?(Admin) && user
redirect_to :back
return
end

0 comments on commit fa2a105

Please sign in to comment.