profile updater

This commit is contained in:
Mark Moser
2016-08-24 12:53:21 -05:00
parent 94ae3c9687
commit 963517e4bb
5 changed files with 51 additions and 9 deletions

View File

@ -1,16 +1,25 @@
module Admin
class ProfileController < ApplicationController
class ProfileController < AdminController
def view
end
def edit
@user = current_admin
end
def update
redirect_to admin_profile_path
@user = current_admin
if @user.update_attributes(user_params)
redirect_to admin_profile_path,
flash: { success: "Sucessfully updated profile" }
else
flash[:error] = "Failed to update profile."
render :edit
end
end
def lost_password
end
end
end
end

View File

@ -1,6 +1,6 @@
class AdminController < ApplicationController
layout 'admin'
before_action :authorize_admin, except: :styleguide
before_action :authorize_admin
def dashboard
@quizzes = Quiz.includes(:questions).all