<commit_before>class ArticlesController < ApplicationController

  def index
    @articles = Article.all
  end

  def show
    @article = Article.find(params[:id])
  end

  def new
  end

  def edit

  end

  def create
    @article = Article.new(article_params)
    # @article = Article.new(params.require(:article).permit(:title, :text)
    @article.save
    redirect_to @article
  end

  def update

  end

  def destroy

  end

  private
  def article_params
    params.require(:article).permit(:title, :text)
  end

end<commit_msg>modify create route to render form again if entry is invalid<commit_after>class ArticlesController < ApplicationController

  def index
    @articles = Article.all
  end

  def show
    @article = Article.find(params[:id])
  end

  def new
  end

  def edit

  end

  def create
    @article = Article.new(article_params)
    # @article = Article.new(params.require(:article).permit(:title, :text)
    if @article.save
      redirect_to @article
    else
      render 'new'
    end
  end

  def update

  end

  def destroy

  end

  private
  def article_params
    params.require(:article).permit(:title, :text)
  end

end
{'fraction_non_alphanumeric': 0.08448275862068966, 'fraction_numerical': 0.0, 'mean_word_length': 2.9489795918367347, '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': '7542541', 'n_tokens_mistral': 381, 'n_tokens_neox': 354, 'n_words': 100}