Rails3のRails2からの変更点

Head First Railsを読んでみた.

Railsを使ったことのない人には少し難しいかもしれないけど,とても分かりやすくてよかった.
ただこの本はRails2を使っていて,これをRails3で試すのにいくつか変更点があったのでメモ.

route.rb

map.connect ‘/flights/:flight_id/seats’, :action => ‘flight_seats’, :controller => ’seats’

match ‘flights/:flight_id/seats’, :to => ’seats#flight_seats’

Ajaxメソッド

・link_to_remote() → link_to(:remote => true)

また,periodically_call_remote()はRails3では無くなってしまったらしいので,
代わりにPrototype Legacy Helperというプラグインを入れることで使えるようになる.

Gemfileに以下を記述

gem ‘prototype_legacy_helper’, ‘0.0.0′, :git => ‘git://github.com/rails/prototype_legacy_helper.git’

あとはbundle installすればOK.

詳細を知りたい人はこちらのURLをどうぞ.
http://www.simonecarletti.com/blog/2010/06/unobtrusive-javascript-in-rails-3/
http://curiosity-drives.me/programming/rails/rails3-prototype-legacy-helper/
http://d.hatena.ne.jp/rails_room/20100915/1284567155

コメント

コメントする