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: wiki_controller.rb
    path of file: ./repos/moebooru/app/controllers
    
    the code of the file until where you have to start completion: # encoding: utf-8

class WikiController < ApplicationControl
    
  def revert
    params[:title] = parse_str(params[:title])
    @page = WikiPage.find_page(params[:title])

    if @page.is_locked?
      respond_to_error("Page is locked", { action: "show", title: params[:title] }, status: 422)
    else
      @page.revert_to(params[:version])
      @page.ip_addr = request.remote_ip
      @page.user_id = @current_user.id

      if @page.save
        respond_to_success("Page reverted", action: "show", title: params[:title])
      else
        respond_to_error((@page.errors.full_messages.first rescue "Error reverting page"), action: "show", title: params[:title])
      end