This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| p "hello #{3}" | |
| num = 5 | |
| p "hello #{num}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # principal amount | |
| p = 10_000 | |
| # annual rate of interest | |
| r = 0.05 | |
| # number of years | |
| t = 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def link(address, text) | |
| "URL is at: <a href='#{address}'>, #{text}</a>" | |
| end | |
| p link("http://www.github.com/9cardinals/", "my github") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def lock(key1,key2,key3,key4) | |
| if | |
| (key1 == 3 || key1 == 5 || key1 == 7) && (key2 == 2) && (key3 == 5 || key3 == 6) && (key4 == 8 || key4 == 9 || key4 == 0) | |
| then | |
| "unlocked" | |
| else | |
| "locked" | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| here's the gemfile: | |
| source 'https://rubygems.org' | |
| # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
| gem 'rails', '4.0.1' | |
| # Use sqlite3 as the database for Active Record | |
| group :production do | |
| gem 'pg' | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source 'https://rubygems.org' | |
| # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
| gem 'rails', '4.0.1' | |
| # Use sqlite3 as the database for Active Record | |
| group :production do | |
| gem 'pg' | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source 'https://rubygems.org' | |
| # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
| gem 'rails', '4.0.1' | |
| # Use sqlite3 as the database for Active Record | |
| group :production do | |
| gem 'pg' | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source 'https://rubygems.org' | |
| # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
| gem 'rails', '3.2.12' | |
| # Use sqlite3 as the database for Active Record | |
| group :production do | |
| gem 'pg' | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Last login: Sun Nov 24 18:05:32 on console | |
| vera:code monicacardinal$ cd bloccit/ | |
| vera:bloccit monicacardinal$ ls -a | |
| . Gemfile app db tmp | |
| .. Gemfile.lock bin lib vendor | |
| .git README.md config log | |
| .gitignore Rakefile config.ru public | |
| vera:bloccit monicacardinal$ rails s | |
| Usage: | |
| rails new APP_PATH [options] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vera:bloccit monicacardinal$ bundle exec bin/rails generate model Post title:string body text | |
| invoke active_record | |
| /Users/monicacardinal/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-3.2.12/lib/active_record/dynamic_matchers.rb:55:in `method_missing': undefined method `migration_error=' for #<Class:0x007fa9d3fdaca8> (NoMethodError) | |
| from /Users/monicacardinal/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-3.2.12/lib/active_record/railtie.rb:66:in `block (3 levels) in <class:Railtie>' | |
| from /Users/monicacardinal/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-3.2.12/lib/active_record/railtie.rb:65:in `each' | |
| from /Users/monicacardinal/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-3.2.12/lib/active_record/railtie.rb:65:in `block (2 levels) in <class:Railtie>' | |
| from /Users/monicacardinal/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-3.2.12/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval' | |
| from /Users/monicacardinal/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-3.2.12/lib/active_support/lazy_load_hooks.rb:36 |
OlderNewer