class ProfilesController < ApplicationController before_filter :authenticate before_action :set_profile def show end def edit end def update if @profile.update_attributes(profile_params) redirect_to profile_path, notice: "Success! Your profile was updated.".html_safe else render action: "edit", warning: "Attention! A problem occurred while trying to update your profile. Plese try again".html_safe end end def history @activities = doer.activities.by_recent end private # Use callbacks to share common setup or constraints between actions. def set_profile @profile = Profile.find(current_user) end # Never trust parameters from the scary internet, only allow the white list through. def profile_params params.require(:profile).permit( :first_name, :last_name, :other_name ) end end