<commit_before>class UserEntriesController < ApplicationController
  before_action :set_user_entry, only: [:destroy]

  # POST /user_entries
  # POST /user_entries.json
  def create
    @user_entry = UserEntry.new(user_entry_params)

    respond_to do |format|
      if @user_entry.save
        format.html { redirect_to entries_path, notice: 'UserEntry was successfully created.' }
        format.json { render :show, status: :created, location: @user_entry }
      else
        format.html { redirect_to entries_path, notice: @user_entry.errors }
        format.json { render json: @user_entry.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /user_entries/1
  # DELETE /user_entries/1.json
  def destroy
    if @user_entry.destroy
      format.html { redirect_to entries_path, notice: 'UserEntry was successfully destroyed.' }
      format.json { render :show, status: :created, location: @user_entry }
    else
      format.html { redirect_to entries_path, notice: @user_entry.errors }
      format.json { render json: @user_entry.errors, status: :unprocessable_entity }
    end
  end

  private

    def set_user_entry
      @user_entry = UserEntry.find(params[:id])
    end

    def user_entry_params
      params.require(:user_entry).permit(:user_id, :entry_id)
    end
end
<commit_msg>Fix bug of user_entries#destroy: add respond_to<commit_after>class UserEntriesController < ApplicationController
  before_action :set_user_entry, only: [:destroy]

  # POST /user_entries
  # POST /user_entries.json
  def create
    @user_entry = UserEntry.new(user_entry_params)

    respond_to do |format|
      if @user_entry.save
        format.html { redirect_to entries_path, notice: 'UserEntry was successfully created.' }
        format.json { render :show, status: :created, location: @user_entry }
      else
        format.html { redirect_to entries_path, notice: @user_entry.errors }
        format.json { render json: @user_entry.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /user_entries/1
  # DELETE /user_entries/1.json
  def destroy
    respond_to do |format|
      if @user_entry.destroy
        format.html { redirect_to entries_path, notice: 'UserEntry was successfully destroyed.' }
        format.json { render :show, status: :created, location: @user_entry }
      else
        format.html { redirect_to entries_path, notice: @user_entry.errors }
        format.json { render json: @user_entry.errors, status: :unprocessable_entity }
      end
    end
  end

  private

    def set_user_entry
      @user_entry = UserEntry.find(params[:id])
    end

    def user_entry_params
      params.require(:user_entry).permit(:user_id, :entry_id)
    end
end

{'fraction_non_alphanumeric': 0.08887256702166728, 'fraction_numerical': 0.0014689680499449136, 'mean_word_length': 3.2830188679245285, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2967312', 'n_tokens_mistral': 839, 'n_tokens_neox': 822, 'n_words': 207}