<commit_before>class UsersController < ApplicationController

  def new
    @user = User.new
  end

    private
  
    def user_params
      params.require(:user).permit(:user_name, :email, :password)
    end
end<commit_msg>Add #create on user controller<commit_after>class UsersController < ApplicationController

  def new
    @user = User.new
  end
  
  def create
    @user = User.new(user_params)

    if @user.save && @user.authenticate(params[:password])
      session[:user_id] = @user.id
      render text: 'user created'
    else
      render text: 'failed user creation'
    end

  end

    private
  
    def user_params
      params.require(:user).permit(:user_name, :email, :password)
    end
end
{'fraction_non_alphanumeric': 0.09436619718309859, 'fraction_numerical': 0.0, 'mean_word_length': 2.99438202247191, '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': '668939', 'n_tokens_mistral': 223, 'n_tokens_neox': 215, 'n_words': 56}