of 199/199
Yuichiro MASUI <[email protected]> なぜRubyでRailsか 最新フレームワーク Ruby on Rails

Ruby de Rails

  • View
    2.035

  • Download
    3

Embed Size (px)

DESCRIPTION

 

Text of Ruby de Rails

  • 1. class User < ActiveRecord::Base end

2. class User < ActiveRecord::Base has_many :books end 3. class User < ActiveRecord::Base set_table_name 'user' set_primary_key 'pkey' end 4. ITPro 5. if a==b then; obj.m(); end a==b && obj.m obj.m if a==b 6. DB (Model)Scaffold HTML 7. DB (Model) ScaffoldHTML 8. class AddNick < ActiveRecord::Migrationdef self.upadd_column :users, :nick, :textend def self.down remove_column :users, :nickend end