Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

addressing a bug in previous commit

  • Loading branch information...
commit 004e1c02da84523000012b00ca1d30329699ba12 1 parent 8239478
@justinfrench authored
Showing with 3 additions and 2 deletions.
  1. +2 −1  lib/formtastic.rb
  2. +1 −1  spec/formtastic_spec.rb
View
3  lib/formtastic.rb
@@ -839,9 +839,10 @@ def country_input(method, options)
raise "To use the :country input, please install a country_select plugin, like this one: http://github.com/rails/iso-3166-country-select" unless self.respond_to?(:country_select)
html_options = options.delete(:input_html) || {}
+ priority_countries = options.delete(:priority_countries) || @@priority_countries
self.label(method, options.slice(:label, :required)) +
- self.country_select(method, options.delete(:priority_countries), set_options(options), html_options)
+ self.country_select(method, priority_countries, set_options(options), html_options)
end
View
2  spec/formtastic_spec.rb
@@ -1205,7 +1205,7 @@ def custom(arg1, arg2, options = {})
builder.stub!(:country_select).and_return("<select><option>...</option></select>")
builder.should_receive(:country_select).with(:country, priority_countries, {}, {}).and_return("<select><option>...</option></select>")
- concat(builder.input(:country, :as => :country, :priority_countries => priority_countries))
+ concat(builder.input(:country, :as => :country))
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.