Switching to Rails3

Major Changes in Rails 3

  1. All the html tags in view will be escaped. We have to use html_safe to tell rails that they are safe to render
  2. render_to_string needs explicit format
  3. render_to_string used with layout and partial will need to define layout with underscore
  4. Routing is different
  5. ViewContext is available to us
  6. New initializers
  7. Blocks with <%= form_for .. %>
  8. No need to call h() blocks
  9. http://edgeguides.rubyonrails.org/3_0_release_notes.html

Let's Run Rails3

$ rvm --create use jruby-1.7.4@rails3
$ alias rails3_env='export IS_RAILS3=true;rvm jruby-1.7.4; rvm gemset use rails3' 
$ alias rails2_env='export IS_RAILS3=false; rvm jruby-1.7.4; rvm gemset use global'
$ alias rails3='rails3_env; script/server3' 
$ alias rails2='rails2_env; jruby script/server'
$ rails2
$ rails3

Switching to Rails3

By amunda

Switching to Rails3

  • 38