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

how to give state short names. #56

Open
dinshawraje opened this issue Apr 16, 2015 · 0 comments
Open

how to give state short names. #56

dinshawraje opened this issue Apr 16, 2015 · 0 comments

Comments

@dinshawraje
Copy link

I have given this in my view:

<div class="input-control select country_input" data-role="input-control">
      <%= f.select :country, region_options_for_select(only_us_and_france),:prompt => 'Select Country' %>
</div>               
<div class="input-control select state_input" data-role="input-control">
          <%= render partial: 'subregion_select', locals: {parent_region: f.object.country} %>
 </div>

and in my subregion partial this:

<div id="account_state_code_wrapper" >
  <% parent_region ||= params[:parent_region] %>
  <% country = Carmen::Country.coded(parent_region) %>

  <% if country.nil? %>
      <div style="display: none">State</div>
  <% elsif country.subregions? %>
      <%= subregion_select(:account_detail, :state_code, parent_region) %>
  <% else %>
      <%= text_field(:account_detail, :state_code) %>
  <% end %>
</div>

So its showing the name of countries and states but I want to show in my select option like Ak and Al so on for state also.
Please help me out. Thanks in advance.

@dinshawraje dinshawraje changed the title how to give country short and state short names. how to give state short names. Apr 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant