Skip to content

Commit

Permalink
initial commit (#1291)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwang7517 authored Dec 20, 2024
1 parent 51f7a1e commit 59c1ed0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/views/shared/_location_fields.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- Country Select -->
<div class="form-group w-100">
<%= form.select :country,
COUNTRIES_STATES.keys.index_with { |abbr| COUNTRIES_STATES.dig(abbr, :name) }.invert,
{ prompt: "Please select" },
Expand All @@ -9,7 +10,10 @@
required: true,
class: 'form-control'
} %>
</div>

<!-- Province/State Select -->
<div class="form-group w-100">
<%= form.select :province_state,
form.object.country.present? ?
COUNTRIES_STATES.dig(form.object.country.to_sym, :states)&.map { |abbr, name| [:name, abbr] } : [],
Expand All @@ -19,7 +23,11 @@
required: true,
class: 'form-control'
} %>
</div>

<!-- City/Town Text Field -->
<div class="form-group w-100">
<%= form.text_field :city_town,
required: true,
class: "form-control" %>
</div>

0 comments on commit 59c1ed0

Please sign in to comment.