Skip to content

Commit

Permalink
Merge pull request #30 from martinb35/master
Browse files Browse the repository at this point in the history
":prompt" parameter have to be second (if there are more than one use "{}")
  • Loading branch information
cdainmiller committed Jun 30, 2013
2 parents 554ddf6 + 8077446 commit 2923ea7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ gem 'carmen-rails', '~> 1.0.0'
<%= form_for(@order) do |f| %>
<div class="field">
<%= f.label :country_code %><br />
<%= f.country_select :country_code, {priority: %w(US CA)}, prompt: 'Please select a country' %>
<%= f.country_select :country_code, {priority: %w(US CA), prompt: 'Please select a country'} %>
</div>
<% end %>
```
Expand Down
2 changes: 1 addition & 1 deletion lib/carmen/rails/action_view/form_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def to_region_select_tag(parent_region, options = {}, html_options = {})
html_options = html_options.stringify_keys
add_default_name_and_id(html_options)
priority_regions = options[:priority] || []
value = value(object) ? value(object) : options[:selected]
value = options[:selected] ? options[:selected] : value(object)
opts = add_options(region_options_for_select(parent_region.subregions, value, :priority => priority_regions), options, value)
content_tag("select", opts, html_options)
end
Expand Down

0 comments on commit 2923ea7

Please sign in to comment.