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: projects_controller.rb
    path of file: ./repos/catarse/app/controllers
    
    the code of the file until where you have to start completion: # coding: utf
    
  def update
    authorize resource

    # need to check this before setting new attributes
    should_validate = should_use_validate
    
    resource.localized.attributes = permitted_params.compact
    # can't use localized for fee
    if permitted_params[:service_fee].present?
      resource.service_fee = permitted_params[:service_fee]
    end