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

class LikesController < ApplicationController
  before_action :authenticate_user!, only: %i[create destroy]
  before_action :set_likeable

 
    
  def set_likeable
    @success = false
    @element_id = "likeable_#{params[:type]}_#{params[:id]}"

    defined_action = User.find_defined_action(:like, params[:type])

    if defined_action.blank?
      render plain: "-1"
      return false
    end