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: html_variants_controller.rb
    path of file: ./repos/forem/app/controllers/admin
    
    the code of the file until where you have to start completion: module Admin
  class HtmlVariantsController < Admin::ApplicationCont
    
    def update
      @html_variant = HtmlVariant.find(params[:id])

      if @html_variant.update(html_variant_params)
        flash[:success] = I18n.t("admin.html_variants_controller.updated")
        redirect_to edit_admin_html_variant_path(@html_variant)
      else
        flash[:danger] = @html_variant.errors_as_sentence
        render :edit
      end