No description, website, or topics provided.
Ruby JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
config
db
doc
public
script
test
.gitignore
README.rdoc
Rakefile

README.rdoc

Requirement

Rails >= 2.3.4

Console

require 'hirb'
Hirb.enable
Country.all

Important code

build two model

./script/generate model operating_system name:string
./script/generate model country name:string code:string

create db seed

require 'open-uri'
require 'active_record/fixtures'

["Windows", "Linux", "Mac OSX"].each do |os|
  OperatingSystem.find_or_create_by_name(os)
end

Country.delete_all
open("http://openconcept.ca/sites/openconcept.ca/files/country_code_drupal_0.txt") do |countries|
  countries.read.each_line do |country|
    code, name = country.chomp.split("|")
    Country.create!(:name => name, :code => code)
  end
end

Fixtures.create_fixtures("#{Rails.root}/test/fixtures", "operation_systems")

Install Hirb

gem install cldwalker-hirb --source http://gems.github.com/

Hirb config

vi ~/.irbrc
require 'rubygems'
require 'hirb'
Hirb::View.enable

Links