I put this in my gemfile
gem 'country_select'
I run bundle install
I put this in my form
= f.country_select(:country, priority_countries: ["US"])
Then when I restart the server and load the page I get the following error:
ActionView::Template::Error (wrong number of arguments (given 1, expected 0)):
Rails 5.2
here is the entire form:
= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
.row
.col.s12
= devise_error_messages!
.row
.input-field.col.s12
= f.text_field :city
= f.label :city
.row
.input-field.col.s12
= f.label :country
%br
= f.country_select(:country, priority_countries: ["US"])
This is the error:
ActionView::Template::Error (wrong number of arguments (given 1, expected 0)):
20: .input-field.col.s12
21: = f.label :country
22: %br
23: = f.country_select(:country, priority_countries: ["US"])
Hi As per the user docs
Because you are using with devise I am assuming you are using this on your user model, there for you must call country_select("user", "country", priority_countries: ["US"])
If your devise model is called something else, replace user with the model name
In reference to the issue that I opened on GitHub.
Running bundle update
and restarting the rails server solves the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With