carmen-rails icon indicating copy to clipboard operation
carmen-rails copied to clipboard

carmen rails

Open reiranke opened this issue 11 years ago • 4 comments

hi i got this error NoMethodError at /signup undefined method `downcase' for nil:NilClass

this--->
  <% if country.nil? %>
   <em>Please select a country above</em>
 <% elsif country.subregions? %>
   <%= subregion_select(:order, :state_code, parent_region) %>

reiranke avatar Jul 31 '13 07:07 reiranke

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.

desmondcain avatar Aug 10 '13 20:08 desmondcain

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.

mmastoras avatar Oct 19 '13 06:10 mmastoras

Oh, that's excellent!

frandroid avatar Oct 19 '13 15:10 frandroid

@mmastoras Thanks! That worked for me too. I hope rails 4 support comes soon!

robvelor avatar Nov 08 '13 22:11 robvelor