app/controllers/users_controller.rb
def update
    @user = User.find(params[:id])
    if @user.update(user_params)
      flash[:success] = "Profile updated"
      redirect_to @user
    else
      render 'edit'
    end
  end
# by default before filters apply to every action in a controller, which is not we want e.g. in sign up page
# thus we limit it to only edit and update actions
by default before filters apply to every action in a controller, which is not we want e.g. in sign up page
thus we limit it to only edit and update actions
by default before filters apply to every action in a controller which is not we want e . g . in sign up page thus we limit it to only edit and update actions
def update
    @user = User.find(params[:id])
    if @user.update(user_params)
      flash[:success] = "Profile updated"
      redirect_to @user
    else
      render 'edit'
    end
  end
def update @user = User . find ( params [ :id ] ) if @user . update ( user_params ) flash [ :success ] = "Profile updated" redirect_to @user else render 'edit' end end
by default before filters apply to every action in a controller, which is not we want e.g.
by default before filters apply to every action in a controller which is not we want e . g .