ミームの死骸を待ちながら

We are built as gene machines and cultured as meme machines, but we have the power to turn against our creators. We, alone on earth, can rebel against the tyranny of the selfish replicators. - Richard Dawkins "Selfish Gene"

We are built as gene machines and cultured as meme machines, but we have the power to turn against our creators.
We, alone on earth, can rebel against the tyranny of the selfish replicators.
- Richard Dawkins "Selfish Gene"

かんたんRuby on Rails 4日目

かんたんRuby on RailsでWebアプリケーション開発の4日目をやる。rake, migrateがイカレており治し方の見当が付かないため、人力でがりがりMySQLにdatabaseとtable作って*1、controllerのメソッドから

@pages = Page.find(:all, :order => 'created_at DESC')

インスタンス変数にぶちこんでやる。(これってArrayで入ってんだよね??)それをviewでpages.eachでばらしてパラメータを表示さす。
途中詰まったんだが、手動でMySQL作った時もdatabase.ymlを設定しないと繋がらないわけね。逆を言えばこいつを設定しておけばMySQLからデータinsertしてもちゃんと認識。当然か。migrateやrakeはただ楽するためのツール?

*1:日付型に入れる日付は2006-09-20ではだめで'2006-09-20'でなければならない。よく忘れる。