From e98a0c956c1640f1b906c63713ec32e9b04b2d72 Mon Sep 17 00:00:00 2001 From: Andrew Radev Date: Sat, 30 May 2015 15:29:07 +0300 Subject: [PATCH] User editing fixes --- app/controllers/management/users_controller.rb | 2 +- app/views/management/users/edit.html.slim | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/management/users_controller.rb b/app/controllers/management/users_controller.rb index 5bffbbe..64b1c5c 100644 --- a/app/controllers/management/users_controller.rb +++ b/app/controllers/management/users_controller.rb @@ -16,7 +16,7 @@ module Management def edit @user = find_user - @user.build_speaker_profile + @user.build_speaker_profile if @user.speaker_profile.blank? end def update diff --git a/app/views/management/users/edit.html.slim b/app/views/management/users/edit.html.slim index c0316b9..cefddf4 100644 --- a/app/views/management/users/edit.html.slim +++ b/app/views/management/users/edit.html.slim @@ -16,7 +16,13 @@ hr .row .col-lg-12 + - speaker_profile = @user.speaker_profile + = f.simple_fields_for :speaker_profile do |ff| + - if speaker_profile.picture.present? + .col-sm-offset-3.col-sm-9 + = image_tag speaker_profile.picture.medium.url, class: 'img-thumbnail' + = ff.input :picture, wrapper: :horizontal_file_input -# Required