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: campaigns_controller.rb
    path of file: ./repos/ekylibre/app/controllers/backend
    
    the code of the file until where you have to start completion: # == License
# Ekylibre - Simple agricultural ERP
# Copyright (C) 2008-2013 David Joulin, Brice Texie
    
    def show_by_name
      @campaign = Campaign.find_or_create_by!(harvest_year: params[:name].to_i)

      respond_to do |format|
        format.json
      end
    end