From 3c20929fe3492ea7ba22593ef95f6b500f4e1f2d Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Fri, 20 Dec 2024 00:10:15 -0800 Subject: [PATCH] initial commit --- app/views/shared/_location_fields.html.erb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/views/shared/_location_fields.html.erb b/app/views/shared/_location_fields.html.erb index b01a2b4e9..cbcc4140e 100644 --- a/app/views/shared/_location_fields.html.erb +++ b/app/views/shared/_location_fields.html.erb @@ -1,4 +1,5 @@ +
<%= form.select :country, COUNTRIES_STATES.keys.index_with { |abbr| COUNTRIES_STATES.dig(abbr, :name) }.invert, { prompt: "Please select" }, @@ -9,7 +10,10 @@ required: true, class: 'form-control' } %> +
+ +
<%= form.select :province_state, form.object.country.present? ? COUNTRIES_STATES.dig(form.object.country.to_sym, :states)&.map { |abbr, name| [:name, abbr] } : [], @@ -19,7 +23,11 @@ required: true, class: 'form-control' } %> +
+ +
<%= form.text_field :city_town, required: true, class: "form-control" %> +
\ No newline at end of file