skill-assessment-app/app/controllers/admin/profile_controller.rb

26 lines
474 B
Ruby
Raw Normal View History

2016-08-24 10:43:33 -05:00
module Admin
2016-08-24 12:53:21 -05:00
class ProfileController < AdminController
2016-08-24 10:43:33 -05:00
def view
end
def edit
2016-08-24 12:53:21 -05:00
@user = current_admin
2016-08-24 10:43:33 -05:00
end
def update
2016-08-24 12:53:21 -05:00
@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
2016-08-24 10:43:33 -05:00
end
def lost_password
2016-08-24 12:53:21 -05:00
end
2016-08-24 10:43:33 -05:00
end
end