Sorry, the code should have been:

 def destroy
    @user = User.find(params[:id])
    if @user == logged_in_user or 
logged_in_user.has_role?('administrator')
      if @user.destroy
        flash[:notice] = "User deleted"
      else
        flash[:error] = "There was a problem deleting this user."
      end
      redirect_to :action => 'index'
    end
  end

/ V.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to