Created
April 26, 2016 12:31
-
-
Save wolfieorama/79c011efb130e84020bad21ab50f834a to your computer and use it in GitHub Desktop.
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
<%= form_for(@person) do |f| %> | |
<% if @person.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@person.errors.count, "error") %> prohibited this person from being saved:</h2> | |
<ul> | |
<% @person.errors.full_messages.each do |message| %> | |
<li><%= message %></li> | |
<% end %> | |
</ul> | |
</div> | |
<% end %> | |
<div class="field"> | |
<%= f.label :person_name %><br> | |
<%= f.text_field :person_name %> | |
</div> | |
<div id="person_country_id" class="field"> | |
<%= f.label :country %><br /> | |
<%= f.collection_select :country_id, Country.order(:name), :id, :name, include_blank: true %> | |
</div> | |
<div id="person_city_id"class="field"> | |
<%= f.label :city %><br /> | |
<%= f.grouped_collection_select :city_id, Country.order(:name), :cities, :name, :id, :city_name, include_blank: true %> | |
</div> | |
<div class="actions"> | |
<%= f.submit %> | |
</div> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment