<commit_before>get '/' do
  # Look in app/views/index.erb
  erb :index
end

get '/user/:id' do
  @user = User.find_by(id: params[:id])
  erb :'user/user_profile'
end


#update(edit) a user profile
get '/user/:id/edit' do
  @user = User.find(params[:id])
  erb :'user/edit'
end

put '/user/:id' do |id|
  user = User.find(id)
  user.update(params[:user])
  redirect("/user/#{user.id}")
end

<commit_msg>Change User.find to User.find_by<commit_after>get '/' do
  # Look in app/views/index.erb
  erb :index
end

get '/user/:id' do
  @user = User.find_by(id: params[:id])
  erb :'user/user_profile'
end


#update(edit) a user profile
get '/user/:id/edit' do
  @user = User.find_by(id: params[:id])
  erb :'user/edit'
end

put '/user/:id' do |id|
  user = User.find_by(id)
  user.update(params[:user])
  redirect("/user/#{user.id}")
end

delete '/user/:id' do |id|
  User.find(id).destroy
  redirect('/')
end





{'fraction_non_alphanumeric': 0.1905286343612335, 'fraction_numerical': 0.0, 'mean_word_length': 3.5678391959798996, 'pattern_counts': {'":': 0, '<': 3, '<?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': '204250', 'n_tokens_mistral': 379, 'n_tokens_neox': 381, 'n_words': 87}