<commit_before>class ListingsController < ApplicationController
  include ListingsHelper
  include UsersHelper
  include DonationApplicationsHelper
  before_action :authenticate_user!, except: [:index, :show]

  def new
    @listing = Listing.new
  end

  def create
    @listing = Listing.new(listing_params.merge! creator: current_user)

    if @listing.save
      @listing.categories << Category.find(params[:listing][:category_ids])
      redirect_to listings_path, :notice => "Your listing has been saved"
    else
      redirect_to new_listing_path, :notice => "Your listing could not be created. Make sure all fields are filled out and try again."
    end<commit_msg>Add page title for new listings page<commit_after>class ListingsController < ApplicationController
  include ListingsHelper
  include UsersHelper
  include DonationApplicationsHelper
  before_action :authenticate_user!, except: [:index, :show]

  def new
    @page_title = "Create New Listing"
    @listing = Listing.new
  end

  def create
    @listing = Listing.new(listing_params.merge! creator: current_user)

    if @listing.save
      @listing.categories << Category.find(params[:listing][:category_ids])
      redirect_to listings_path, :notice => "Your listing has been saved"
    else
      redirect_to new_listing_path, :notice => "Your listing could not be created. Make sure all fields are filled out and try again."
    end
{'fraction_non_alphanumeric': 0.07801418439716312, 'fraction_numerical': 0.0, 'mean_word_length': 4.264925373134329, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '6872691', 'n_tokens_mistral': 409, 'n_tokens_neox': 379, 'n_words': 125}