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: templated_controller.rb
    path of file: ./repos/openproject/app/controllers/projects
    
    the code of the file until where you have to start completion: #-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2024 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProj
    
  def change_templated_action(templated)
    service_call = Projects::UpdateService
                     .new(user: current_user,
                          model: @project)
                     .call(templated:)

    if service_call.success?
      flash[:notice] = t(:notice_successful_update)
    else
      messages = [
        t('activerecord.errors.template.header', model: Project.model_name.human, count: service_call.errors.count),
        service_call.message
      ]

      flash[:error] = messages.join(". ")
    end