Skip to content

Instantly share code, notes, and snippets.

@walshyb
Created August 14, 2020 17:17
Show Gist options
  • Save walshyb/bac1516b380f15212a72166e2f5ae4f8 to your computer and use it in GitHub Desktop.
Save walshyb/bac1516b380f15212a72166e2f5ae4f8 to your computer and use it in GitHub Desktop.
Override for the devise new registration view
# app/views/devise/registrations/new.html.erb
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<%= f.fields_for 'email_addresses_attributes[1]' do |e| %>
<div class="field">
<%= e.label :email %><br />
<%= e.email_field :email, autofocus: true, autocomplete: "email" %>
</div>
<% end %>
<div class="field">
<%= f.label :password %>
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em>
<% end %><br />
<%= f.password_field :password, autocomplete: "new-password" %>
</div>
<div class="field">
<%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
</div>
<div class="actions">
<%= f.submit "Sign up" %>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment