Skip to content

Commit

Permalink
Fix registration
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien1018 committed Sep 1, 2023
1 parent dd9d1fb commit e75cb47
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def edit
def create
super
resource.generate_random_avatar
resource.save!
resource.save # errors would have already happened and rendered in super
end

def update
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/registrations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h4 class="page-header">Edit <%= resource_name.to_s.humanize %> <small><%= current_user.username %></small></h4>
<div class="col-xs-12 col-md-6">
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<%= render partial: "shared/errors", locals: {errors: resource.errors, item: 'user'} %>

<div class="form-group">
<%= f.label :nickname %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/registrations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h4 class="page-header">Sign up</h4>
<div class="col-xs-12 col-md-6">
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<%= render partial: "shared/errors", locals: {errors: resource.errors, item: 'user'} %>

<div class="form-group">
<%= f.label :email %>
Expand Down

0 comments on commit e75cb47

Please sign in to comment.