Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add countries to state selection for zones #3037

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<%= zone_form.field_container :state_ids do %>
<%= zone_form.label :state_ids, plural_resource_name(Spree::State) %><br>
<%= zone_form.collection_select :state_ids, @states, :id, :name, {}, { multiple: true, class: "select2 fullwidth" } %>
<%= zone_form.collection_select :state_ids, @states, :id, :state_with_country, {}, { multiple: true, class: "select2 fullwidth" } %>
<% end %>
</fieldset>
</div>
4 changes: 4 additions & 0 deletions core/app/models/spree/state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,9 @@ def <=>(other)
def to_s
name
end

def state_with_country
"#{name} (#{country})"
end
end
end