<commit_before>class EventsController < ApplicationController

  def new
    @event = Event.new
  end

# Only if logged in
  def create
    @event = Event.new(event_params)
    if @event.save
      redirect_to events_path(@event)
    else
      render 'new'
    end
  end

  def show
    @event = Event.find(params[:id])
  end

  def edit
    @event = Event.find(params[:id])
  end

  def update
    @event = Event.find(params[:id])
    if @event.update(params[:id])
      redirect_to events_path
    else
      render 'edit'
    end
  end

  private
    def event_params
      params.require(:event).permit(:location, :start_date_time, :end_date_time)
    end
end<commit_msg>Creating a new event works. Just need to create the event show page now<commit_after>class EventsController < ApplicationController

  def new
    @event = Event.new
  end

# Only if logged in
  def create
    @event = Event.new(event_params)
    if @event.save
      redirect_to events_path(@event)
    else
      render 'new'
    end
  end

  def show
    @event = Event.find(params[:id])
  end

  def edit
    @event = Event.find(params[:id])
  end

  def update
    @event = Event.find(params[:id])
    if @event.update(params[:id])
      redirect_to events_path
    else
      render 'edit'
    end
  end

  private
    def event_params
      params.require(:event).permit(:user_id, :location, :start_date_time, :end_date_time)
    end
end
{'fraction_non_alphanumeric': 0.09366197183098592, 'fraction_numerical': 0.0, 'mean_word_length': 2.759259259259259, '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': '348683', 'n_tokens_mistral': 469, 'n_tokens_neox': 457, 'n_words': 125}