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: questionnaires_controller.rb
    path of file: ./repos/expertiza/app/controllers
    
    the code of the file until where you have to start completion: class QuestionnairesController < ApplicationController
  include AuthorizationHelper
  before_action [:create_questionnaire, :
    
  def toggle_access
    @questionnaire = Questionnaire.find(params[:id])
    @questionnaire.private = !@questionnaire.private
    @questionnaire.save
    @access = @questionnaire.private == true ? 'private' : 'public'
    undo_link("The questionnaire \"#{@questionnaire.name}\" has been successfully made #{@access}. ")
    redirect_to controller: 'tree_display', action: 'list'
  end