diff --git a/app/views/settings/profiles/_form.html.erb b/app/views/settings/profiles/_form.html.erb new file mode 100644 index 0000000..4ba6be8 --- /dev/null +++ b/app/views/settings/profiles/_form.html.erb @@ -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 %> diff --git a/app/views/settings/profiles/edit.html.erb b/app/views/settings/profiles/edit.html.erb index c4b6236..b2fcefe 100644 --- a/app/views/settings/profiles/edit.html.erb +++ b/app/views/settings/profiles/edit.html.erb @@ -5,20 +5,7 @@
- <%= 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 } %>