トップページphp
1001コメント336KB

【Ruby】Ruby on Rails Part6

■ このスレッドは過去ログ倉庫に格納されています
0001nobodyさん2008/10/24(金) 17:46:53ID:???
■前 Ruby on Rails のスレ が
http://pc11.2ch.net/test/read.cgi/php/1207425569/

■参考サイト
<英語>
本家:http://www.rubyonrails.org
API document:http://api.rubyonrails.com/
開発者のblog:http://weblog.rubyonrails.org/
参考wiki:http://wiki.rubyonrails.org/rails

<日本語>
Rails' wiki: http://wiki.fdiary.net/rails/

■参考スレ
Rubyについて Part 33
http://pc11.2ch.net/test/read.cgi/tech/1223709050/
Ruby 初心者スレッド Part 22
http://pc11.2ch.net/test/read.cgi/tech/1221467121/
0236nobodyさん2009/01/09(金) 00:25:00ID:???
$ ./script/generate model Hoge cd:string


class Hoge < ActiveRecord::Base
 set_primary_key :cd
end
02372362009/01/09(金) 00:41:12ID:???
class CreateHoges < ActiveRecord::Migration
 def self.up
  create_table :hoges, :id => false do |t|
   t.string :cd

   t.timestamps
  end
 end

 def self.down
  drop_table :hoges
 end
end

これ忘れてた。:id => false 付ける場所
■ このスレッドは過去ログ倉庫に格納されています