ror/?%A4%F2%BA%EE%A4%C3%A4%C6%A4%DF%A4%EB%2F%A5%E6%A1%BC%A5%B6%A1%BC%A4%F2%C7%A7%BE%DA%A4%B9%A4%EB
パパブログ: RoR : login_gener
or : login中のユーザ情報の取i
@session['user'].login
で、idやloginが取得できる。
ちなみにidはActiveRecordおなじみのidで、
;uC:\nonidata\InstantRails\ruby\bin;
cdC:\nonidata\InstantRails\ruby\bin
C:\nonidata\InstantRails\ruby\bin>gem install login_generator
Successfully e installed login_generator-1.2.2
C:\nonidata\InstantRails>cd C:\nonidata\InstantRails\rails_apps\cookbook
C:\nonidata\InstantRails\rails_apps\cookbook>ruby script/geerate loginfAccount
create lib/login_system.rb
C:\nonidata\InstantRails\rails_apps>cds C:\nonidata\InstantRails\rails_apps\cookboo
k
C:\nonidata\InstantRils\rails_apps\cookbook>ruby script/generate controller test
exists app/controllers/
[Ruby] Rails(ActiveRecord)の多対多関連 - yuum3のお仕事日記
has_one
has_many
belongs_to
has_and_belongs_to_many
habtm と has_many :through (ActiveRecord)
ActiveRecord の歩き方 - Association 編(1) - Rails で行こう! - Ruby on Rails を学ぶ has_many :comments
developerWorks Japan has_one :address
Rubyist Magazine - RubyOnRails を使ってみる 【第 3 回】 ActiveRecord
create メソッドを使うこともできます。create は new したあと save (DB に格納) します。
Rubyist Magazine - RubyOnRails を使ってみる 【第 4 回】 ActionPack
find(:all, :conditions => ["user_name = ?", user_name])
find_all(["user_name = ?", user_name])
find_all_by_user_name(user_name)
Part2 Rubyに学ぶ「Ruby on Railsの正体」:ITpro
book = Product.find_or_create_by_name_and_price('book', 2079)
リスト7●productsテーブルからnameが'book',priceが2079であるようなProduct kカテゴリー 「Ruby」 - はてな匿名イアリー En Chart Usa u q p Best l Making x x Love Position nカテゴリー 「Ruby」 - はてな匿名イアリー En Chart Usa f g Love