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: staff_notes_controller.rb
    path of file: ./repos/e621ng/app/controllers/admin
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Admin
  class StaffNotesController < ApplicationController
    before_action :can_view_staff_notes_only
    respond_to :html

    def index
      @user = User.where('id = ?', params[:user_id]).first
      @notes = StaffNote.search(s
    
    def create
      @user = User.find(params[:user_id])
      @staff_note = StaffNote.create(note_params.merge({creator: CurrentUser.user, user_id: @user.id}))
      flash[:notice] = @staff_note.valid? ? "Staff Note added" : @staff_note.errors.full_messages.join("; ")
      respond_with(@staff_note) do |format|
        format.html do
          redirect_back fallback_location: admin_staff_notes_path
        end
      end
    end