http://guides.rubyonrails.org/association_basics.html
- belongs_to : TABLE_NAME
- has_one : TABLE_NAME [:through => :TABLE_NAME]
- has_many : TABLE_NAME [:through => :TABLE_NAME]
- has_and_belongs_to_many : TABLE_NAME [:join_table => :TABLE_NAME]
class Treehouse | |
def initialize(ladder, happyduckslide, sadsharkslide) | |
@ladder = ladder # => #<StringIO:0x007fb29c0c8a68> | |
@happyduckslide = happyduckslide # => #<IO:<STDOUT>> | |
@sadsharkslide = sadsharkslide # => #<IO:<STDERR>> | |
end # => :initialize | |
def ride | |
name = @ladder.gets().chomp() # => "Josh", "Anna Marie" | |
if rand(2) == 1 # => true, false |
http://guides.rubyonrails.org/association_basics.html
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html | |
Hi everyone, I'm Chris Wanstrath. | |
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But | |
then I took a few moments and thought, Wait, why? Why me? What am I supposed | |
to say that's interesting? Something about Ruby, perhaps. Maybe the | |
future of it. The future of something, at least. That sounds | |
keynote-y. | |