Last active
September 5, 2017 16:40
-
-
Save EssenceOfChaos/f473bb81983401d36573bc4922ce3005 to your computer and use it in GitHub Desktop.
Collecting data for 'hstore' field
This file contains 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
<%=form_with(model: user, local: true, :html=> {class: 'ui form'}) do |form| %> | |
<% if user.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(users.errors.count, "error") %> prohibited this user from being saved:</h2> | |
<ul> | |
<% user.errors.full_messages.each do |message| %> | |
<li> | |
<%=message %> | |
</li> | |
<% end %> | |
</ul> | |
</div> | |
<% end %> | |
<div class="fields"> | |
<div class="six wide field"> | |
<%=form.label :first_name %> | |
<%=form.text_field :first_name, id: :user_first_name %> | |
</div> | |
<div class="six wide required field"> | |
<%=form.label :last_name %> | |
<%=form.text_field :last_name, id: :user_last_name %> | |
</div> | |
</div> | |
<div class="four wide field"> | |
<%=form.label :email %> | |
<%=form.email_field :email, id: :user_email %> | |
</div> | |
<div class="four wide field"> | |
<%=form.label :phone %> | |
<%=form.telephone_field :phone, id: :user_phone %> | |
</div> | |
<!-- #### ADDRESS FIELD STARTS HERE #### --> | |
<div class="fields"> | |
<%=form.fields_for :address do |a| %> | |
<div class="field"> | |
<label>Street address </label> | |
<%= a.text_field :street_address, id: :street_address %> | |
</div> | |
<div class="field"> | |
<label>City </label> | |
<%= a.text_field :city, id: :city %> | |
</div> | |
<div class="two wide field"> | |
<label>State </label> | |
<%=a .text_field :state, id: :state %> | |
</div> | |
<div class="field"> | |
<label>Zip </label> | |
<%= a.number_field :zip_code, id: :zip_code %> | |
</div> | |
</div> | |
<%end%><!-- #### ADDRESS FIELD ENDS HERE #### --> | |
<div class="two wide field"> | |
<%=form.label :eye_color %> | |
<%=form.text_field :eye_color, id: :user_eye_color %> | |
</div> | |
<div class="six wide field"> | |
<label>Date of birth</label> | |
<%=form.date_field :dob, id: :user_dob %> | |
</div> | |
<br> | |
<div class="actions"> | |
<%=form.submit 'Submit', class: 'ui primary button' %> | |
</div> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment