<commit_before>class StoriesController < ApplicationController
  before_action :set_stories, only: [:show, :edit, :destroy, :update]


  def index
    # displays all published stories
    @stories = Story.all
  end

  def show
    # show particular story
    # @story = Story.find
  end

  def new
    # show a new story form
    # @story = Story.new
    @story = Story.new
  end

  def create
    # create new story
    @story = Story.new story_params
    if @story.save
      redirect_to story_path(@story)
    else
      render :new
    end

  end

  def edit
    # edit a particular story
  end

  private

  def set_stories
    @story = Story.find(params[:id])
  end

  def story_params
    params.require(:stories).permit(:title, :content)
  end

  private

  def set_stories
    @story = Story.find(params[:id])
  end

  def story_params
    params.require(:story).permit(:title, :content)
  end


end<commit_msg>set stories controller crud actions<commit_after>class StoriesController < ApplicationController
  before_action :set_stories, only: [:show, :edit, :destroy, :update]

  def index
    # displays all published stories
    @stories = Story.all
  end

  def show
    # show particular story

  end

  def new
    # show a new story form
    # @story = Story.new
    @story = Story.new
  end

  def create
    # create new story
    @story = Story.new story_params
    if @story.save
      redirect_to story_path(@story)
    else
      render :new
    end
<<<<<<< HEAD

=======
>>>>>>> set stories controller crud actions
  end

  def edit
    # edit a particular story
  end

  private

  def set_stories
    @story = Story.find(params[:id])
  end

  def story_params
    params.require(:story).permit(:title, :content)
  end

  private

  def set_stories
    @story = Story.find(params[:id])
  end

  def story_params
    params.require(:story).permit(:title, :content)
  end


end
{'fraction_non_alphanumeric': 0.09320695102685624, 'fraction_numerical': 0.0, 'mean_word_length': 2.7773359840954273, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 10, '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': '113341', 'n_tokens_mistral': 623, 'n_tokens_neox': 593, 'n_words': 179}