<commit_before>class <%= plural_name.camelize %>Controller < ApplicationController

  def index
    @<%= plural_name.underscore %> = <%= class_name %>.all
  end

  def show
    @<%= singular_name.underscore %> = <%= class_name %>.find_by_id(params[:id])
  end

  def new
    @<%= singular_name.underscore %> = <%= class_name %>.new
  end

  def create
    @<%= singular_name.underscore %> = <%= class_name %>.new
    <% attributes.each do |attribute| -%>
@<%= singular_name.underscore %>.<%= attribute.name %> = params[:<%= attribute.name %>]
    <% end %>
    if @<%= singular_name.underscore %>.save
      <% if named_routes? -%>
      redirect_to <%= plural_name %>_url
      <% else -%>
      redirect_to "/<%= plural_name %>"
      <% end -%>
    else
      render 'new'
    end
  end

  def edit
    @<%= singular_name.underscore %> = <%= class_name %>.find_by_id(params[:id])
  end

  def update
    @<%= singular_name.underscore %> = <%= class_name %>.find_by_id(params[:id])
    <% attributes.each do |attribute| -%>
@<%= singular_name.underscore %>.<%= attribute.name %> = params[:<%= attribute.name %>]
    <% end %>
    if @<%= singular_name.underscore %>.save
      <% if named_routes? -%>
      redirect_to <%= plural_name %>_url
      <% else -%>
      redirect_to "/<%= plural_name %>"
      <% end -%>
    else
      render 'edit'
    end
  end

  def destroy
    @<%= singular_name.underscore %> = <%= class_name %>.find_by_id(params[:id])
    @<%= singular_name.underscore %>.destroy
    <% if named_routes? -%>
    redirect_to <%= plural_name %>_url
    <% else -%>
    redirect_to "/<%= plural_name %>"
    <% end -%>
  end
end<commit_msg>Fix formatting<commit_after>class <%= plural_name.camelize %>Controller < ApplicationController

  def index
    @<%= plural_name.underscore %> = <%= class_name %>.all
  end

  def show
    @<%= singular_name.underscore %> = <%= class_name %>.find_by_id(params[:id])
  end

  def new
    @<%= singular_name.underscore %> = <%= class_name %>.new
  end

  def create
    @<%= singular_name.underscore %> = <%= class_name %>.new
    <% attributes.each do |attribute| -%>
@<%= singular_name.underscore %>.<%= attribute.name %> = params[:<%= attribute.name %>]
    <% end %>
<% if named_routes? -%>
    if @<%= singular_name.underscore %>.save
      redirect_to <%= plural_name %>_url
    else
      render 'new'
    end
<% else -%>
    if @<%= singular_name.underscore %>.save
      redirect_to "/<%= plural_name %>"
    else
      render 'new'
    end
<% end -%>
  end

  def edit
    @<%= singular_name.underscore %> = <%= class_name %>.find_by_id(params[:id])
  end

  def update
    @<%= singular_name.underscore %> = <%= class_name %>.find_by_id(params[:id])
    <% attributes.each do |attribute| -%>
@<%= singular_name.underscore %>.<%= attribute.name %> = params[:<%= attribute.name %>]
    <% end %>
<% if named_routes? -%>
    if @<%= singular_name.underscore %>.save
      redirect_to <%= plural_name %>_url
    else
      render 'new'
    end
<% else -%>
    if @<%= singular_name.underscore %>.save
      redirect_to "/<%= plural_name %>"
    else
      render 'new'
    end
<% end -%>
  end

  def destroy
    @<%= singular_name.underscore %> = <%= class_name %>.find_by_id(params[:id])
    @<%= singular_name.underscore %>.destroy
<% if named_routes? -%>
    redirect_to <%= plural_name %>_url
<% else -%>
    redirect_to "/<%= plural_name %>"
<% end -%>
  end
end
{'fraction_non_alphanumeric': 0.18928363424577752, 'fraction_numerical': 0.0, 'mean_word_length': 2.9756944444444446, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 91, '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': '673523', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1170, 'n_words': 226}