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: questions_controller.rb
    path of file: ./repos/rapidfire/app/controllers/rapidfire
    
    the code of the file until where you have to start completion: module Rapidfire
  class QuestionsController < Rapidfire::ApplicationController
    before_action :authenticate_administrator!
    before_action :find_survey!
  
    
    def save_and_redirect(params, on_error_key)
      @question_form = QuestionForm.new(params)
      @question_form.save

      if @question_form.errors.empty?
        respond_to do |format|
          format.html { redirect_to index_location }
          format.js
        end
      else
        respond_to do |format|
          format.html { render on_error_key.to_sym }
          format.js
        end
      end