1
0
Fork 0

Move form into partial

This commit is contained in:
Alex Kotov 2019-09-03 10:41:34 +05:00
parent f6edb386e8
commit 121d9814c5
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
2 changed files with 15 additions and 14 deletions

View File

@ -0,0 +1,14 @@
<%= simple_form_for account, url: settings_profile_path do |f| %>
<%= f.error_notification %>
<%= f.input :nickname, required: true %>
<%= f.input :public_name %>
<%= f.input :biography %>
<%= f.input :avatar, direct_upload: true %>
<% if f.object.avatar.attached? %>
<%= image_tag f.object.avatar, class: 'img-thumbnail mb-4' %>
<% end %>
<%= f.button :submit, translate('users.registrations.edit.update') %>
<% end %>

View File

@ -5,20 +5,7 @@
</div>
<div class="col-md-9">
<%= simple_form_for @account, url: settings_profile_path do |f| %>
<%= f.error_notification %>
<%= f.input :nickname, required: true %>
<%= f.input :public_name %>
<%= f.input :biography %>
<%= f.input :avatar, direct_upload: true %>
<% if f.object.avatar.attached? %>
<%= image_tag f.object.avatar, class: 'img-thumbnail mb-4' %>
<% end %>
<%= f.button :submit, translate('users.registrations.edit.update') %>
<% end %>
<%= render partial: 'form', locals: { account: @account } %>
</div>
</div>
</div>