Created
August 14, 2020 17:49
-
-
Save walshyb/d226114c0ef5ddcf46c956817b2bbb75 to your computer and use it in GitHub Desktop.
Updated devise new registration template that uses Contact association
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 :contact do |c| %> | |
<div class="field"> | |
<%= c.label :name %><br /> | |
<%= c.text_field :name %> | |
</div> | |
<%= c.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 %> | |
<% 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