2

I'm pulling my hair out with this one. I've tried installing the Carmen gem, then uninstalling it and trying this as a plugin, then uninstalling the plugin and re-installing the gem, restarting the server but nothing seems to help.

Doesn't matter what I do, the code can't seem to find the "country_select" method. It always fails on this line:

<%= f.country_select :country_code, {priority: %w(US CA)}, prompt: 'Please select a country' %>

I'm using Ruby 1.9.3
carmen v1.0.0.beta2
carmen-rails v1.0.0.beta3

I really need to get this working but have no idea how to further this along. Please help...

purplerice
  • 473
  • 1
  • 6
  • 22
  • Have you tried it without the form reference? So: <%= country_select :someId, :country_code........ %> – Matt Razza Jun 26 '12 at 19:51
  • Wow - thanks for that blazing fast reply. Unfortunately, that did not seem to help: <%= country_select :prev_country_address, :country_code, nil, prompt: 'Please select a country' %> still gave me almost the same error msg: undefined method `country_select' for #<#:0x591fd80> (Class instead of ActionView::Helper...). I don't mind trying a 100 more things if you have any other ideas. – purplerice Jun 26 '12 at 20:07

2 Answers2

3

I came across this with simple_form, it turns out that it depends on gem country_select, if you get this error working with simple_form then install the gem:

gem 'country_select'

Then restart your server:

rails s
Kingsley Ijomah
  • 3,273
  • 33
  • 25
1

I encountered the same. I resolved it by changing :country_code to the name of the field in my model that held the country value. For example, in my model I used country and thus I changed :country_code to :country and it worked fine.

Alan Ruth
  • 193
  • 1
  • 7