Is Ubuntu the new Linux?

Posted by Jorge Bernal August 15, 2008

I’ve found this today at the shoes website, and I think it’s not the first time I see someone using the Ubuntu logo or name to refer to a Linux system.

If rms already had a bad time trying to convince people to use GNU/Linux instead of Linux, it seems he is getting more work to do :)

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4 out of 5)
Loading ... Loading ...

Store countries with ISO-3166 codes in rails

Posted by Jorge Bernal August 15, 2008

I’ve been trying to give rebirth to an old internal project at my company, abandoned circa 2006, and this is one of the code pieces I think it could be useful to others.

I wanted to store country information as an ISO code, so here is the plugin to make it work

It’s translated using the translation from the iso-codes package, so I guess it’s as good as it can get by now. If you want to contribute, please do it to the iso-codes package and let me know, so I can update it too.

iso_countries - Store countries using ISO 3166 codes

This rails plugin enables you to store country info only with the country’s ISO-3166 code

Example

  class Company < ActiveRecord::Base
    iso_country :country
  end

  c = Company.new :country => "es"
  c.country                 # => "es"
  c.country_name            # => "Spain"
  c.country_name = "France"
  c.country                 # => "fr"
  ISO::Countries.set_language "es"
  c.country_name            # => "Francia"

Download

You can get it from http://github.com/koke/iso_countries/tree/master

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...