Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rails 3.1 - Confoo

Lori M Olson
February 29, 2012

Rails 3.1 - Confoo

Another new version of Rails. Delightful. And terrifying. What's changed this time? Fear Not!

We'll be reviewing the changes and additions to Rails 3.1, giving you a walk-through of what it all means (asset pipeline, what?), in the context of a brand new app, and an older app that will need to be upgraded.

Lori M Olson

February 29, 2012

More Decks by Lori M Olson

Other Decks in Programming


  1. But... • What about Rails 3.2? • only released a

    few weeks ago • not nearly as many scary changes
  2. • How to go back to Prototype (not recommended •

    rails new my_app -j prototype What you HAVE to know
  3. • Nothing • Absolutely not required • Just remove one

    line from Gemfile • gem 'coffee-rails' • And you don’t even have to do this What you HAVE to know
  4. Thomas Fuchs on CoffeeScript • May 2011 - "I just

    like javascript too much to have a use for that, but I understand why other people might like it" • Aug 2011 - There, it happened. Mistakenly typed CoffeeScript in a .js file. So easy to pick up, and so natural.
  5. CoffeeScript Resources • Railscasts • CoffeeScript Basics • http://railscasts.com/episodes/267-coffeescript-basics •

    Peepcode • Meet CoffeeScript • http://peepcode.com/products/coffeescript • Books • Pragmatic Programmers - CoffeeScript • O’Reilly - The Little Book on CoffeeScript
  6. • Nothing • Absolutely not required • Just remove one

    line from your Gemfile • gem 'sass-rails' • And you don’t even have to do that What you HAVE to know
  7. Is it SASS or SCSS? • Sass is the older

    style HAML-like indented syntax • SCSS is the new main syntax, which is a superset of CSS3
  8. Why SASS? • Variables • Nesting • DRY up your

    styles • Mixins • reusable chunks • with arguments! • Selector Inheritance
  9. Alternatives to SASS • Less • HSS • Other, technology

    specific • XCSS (PHP) • CleverCss (Python) • CSS Crush (PHP)
  10. js manifest • Powered by - Sprockets • application.js //

    FIXME: Tell people that this is a manifest file, real code should go into discrete files // //= require jquery //= require jquery_ujs //= require_tree .
  11. SASS - no sprockets • probably don’t want to use

    manifests • use @import, or your variables and scopes will not work
  12. Dev vs Production • To precompile, or not to precompile

    • Heroku • Cedar stack • counter-intuitive settings
  13. • application.rb # Enable IdentityMap for Active Record, to disable

    set to false or remove the line below. config.active_record.identity_map = true enabling
  14. Bundler • Did you know... you can use bundler all

    the way down to Rails 2.1 apps?
  15. Assets • Move asset folders • Fix image references •

    Manifests • stylesheet and javascript tag references