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