carmen-rails
carmen-rails copied to clipboard
carmen rails
hi i got this error NoMethodError at /signup undefined method `downcase' for nil:NilClass
<% if country.nil? %>
<em>Please select a country above</em>
<% elsif country.subregions? %>
<%= subregion_select(:order, :state_code, parent_region) %>
I had to alter this block a bit by adding a conditional to handle nil parent_regions
<% unless parent_region.nil? %>
<% country = Carmen::Country.coded(parent_region) %>
<% end %>
This worked for me but I'm not sure if this is the best workaround so I'm open to corrections by anyone more knowledgeable on this specific issue.
What worked for me was to create the country_code and state_code migration with :default => "" as Carmen::Country.coded will handle being passed a "" but not a nil.
Oh, that's excellent!
@mmastoras Thanks! That worked for me too. I hope rails 4 support comes soon!