Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

carmen rails #35

Open
reiranke opened this issue Jul 31, 2013 · 4 comments
Open

carmen rails #35

reiranke opened this issue Jul 31, 2013 · 4 comments

Comments

@reiranke
Copy link

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

<% parent_region ||= params[:parent_region] %> this---> <% country = Carmen::Country.coded(parent_region) %>
  <% if country.nil? %>
   <em>Please select a country above</em>
 <% elsif country.subregions? %>
   <%= subregion_select(:order, :state_code, parent_region) %>
@desmondcain
Copy link

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.

@mmastoras
Copy link

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.

@frandroid
Copy link

Oh, that's excellent!

@robvelor
Copy link

robvelor commented Nov 8, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants