You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: users_controller.rb
    path of file: ./repos/rails_contact_list/app/controllers
    
    the code of the file until where you have to start completion: class UsersController < ApplicationController

  before_action :require_logged_in_user, only: [:show, :edit, 
    
  def update
    if current_user.update(user_params)
      flash[:success] = 'Dados atualizados com sucesso'
      redirect_to user_contacts_url(current_user)
    else
      render 'edit'
    end