From f515bf7beae22a98a22d6e5c766b784369385266 Mon Sep 17 00:00:00 2001 From: nilsding Date: Tue, 4 Nov 2014 15:56:00 +0100 Subject: [PATCH] =?UTF-8?q?=E2=80=94=E2=82=AC=20this.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/user_controller.rb | 2 +- app/views/user/edit.html.haml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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