Appendix A. Migrating to Rails 1.2
This appendix lists features and changes between Rails 1.1.6 and Rails 1.2. Old (1.1.6) code will run under Rails 1.2, but youâll get warnings for deprecated features. Support for deprecated features will be removed in the next major release of Rails (2.0). The quickest way to find out what needs updating is to run your Rails 1.1.6 application under Rails 1.2, and check your logs for deprecation warnings.
Action Controller
Rails 1.1.6 | Rails 1.2 |
@cookies | cookies |
@env | env |
@flash | flash |
@headers | headers |
@params | params |
@request | request |
@response | response |
@session | session |
Rails 1.1.6 | Rails 1.2 |
expire_matched_fragments | expire_fragment |
keep_flash | flash.keep |
parse_query_parameters | parse_form_encoded_parameters |
parse_request_parameters | parse_form_encoded_parameters |
redirect_to_path | redirect_to(
path ) |
redirect_to_url | redirect_to(
url ) |
render('#{options}') | render :file =>
#{options} |
url_for(:#{options}) | Call url_for with a
named route directly |
Rails 1.1.6 | Rails 1.2 |
assert_assigned_equal | assert_equal(expected,
@response.template.assigns[key.to_s]) |
assert_cookie_equal | assert(@response.cookies.key?(key)) |
assert_flash_empty | assert(!@response.has_flash_with_contents?) |
assert_flash_equal | assert_equal(expected,
@response.flash[key]) |
assert_flash_exists | assert(@response.has_flash?) |
assert_flash_has | assert(@response.has_flash_object?(key)) |
assert_flash_has_no | assert(!@response.has_flash_object?(key)) ... |
Get Rails Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.