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

Complete country name from the code like 'Australia' from 'AU' #18

Open
ayraju opened this issue Feb 7, 2013 · 6 comments
Open

Complete country name from the code like 'Australia' from 'AU' #18

ayraju opened this issue Feb 7, 2013 · 6 comments

Comments

@ayraju
Copy link

ayraju commented Feb 7, 2013

How can we get complete country name from the code like 'Australia' from 'AU'?

Any help?

@jason-rutherford
Copy link

c = Carmen::Country.coded('AU')
 => <#Carmen::Country name="Australia"> 
c.name
 => "Australia" 

@ayraju
Copy link
Author

ayraju commented Mar 12, 2013

@c= 'US'
@Country = Carmen::Country.coded(@c)

yes I found this but forgot to update it .

Anyway thank you.

@lawrobi
Copy link

lawrobi commented Dec 9, 2013

If we write this way in the controller

@c = 'current_user.country_code'
@Country = Carmen::Country.coded(@c)

It doesn't work ...

Can you help?

@frandroid
Copy link

You say it doesn't work, but you don't say how. What do you get when you do
p @Country
in the console, or you print @Country on your web page? Surely some form of object got passed to @Country... :) Look at both jason's and raju's code to understand.

@lawrobi
Copy link

lawrobi commented Dec 9, 2013

yes when I print @Country there is nothing (blank)... even though country_zone = US for that user.

@frandroid
Copy link

My point is that what's returned is not a string, but a Country object. Maybe you could invoke the object's .name method?

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

4 participants