diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 09d879b5..3245c234 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -8,7 +8,7 @@ class UserController < ApplicationController end def update - params.permit(:display_name) + params.require(:display_name) current_user.display_name = params[:display_name] current_user.save! redirect_to edit_user_profile_path diff --git a/app/views/user/edit.html.haml b/app/views/user/edit.html.haml index e57d1a48..786d0dbf 100644 --- a/app/views/user/edit.html.haml +++ b/app/views/user/edit.html.haml @@ -1,4 +1,8 @@ .container.j2-page = render 'settings_tabs' .col-md-9.col-xs-12.col-sm-9 - %i TODO \ No newline at end of file + = bootstrap_form_for(update_user_profile_path, method: "patch") do |f| + + = f.text_field :display_name, label: "Your name" + + = f.submit \ No newline at end of file