rails 3.1 sneak peak
DESCRIPTION
Sneak peak of Rails 3.1 new featuresTRANSCRIPT
![Page 2: Rails 3.1 sneak peak](https://reader035.vdocuments.site/reader035/viewer/2022062513/5550d7afb4c905e8318b5126/html5/thumbnails/2.jpg)
Currently RC4, to be released soon
Aaron Patterson
Core team, in rc4 infoRails 3.1.0.rc4 has been released!
![Page 3: Rails 3.1 sneak peak](https://reader035.vdocuments.site/reader035/viewer/2022062513/5550d7afb4c905e8318b5126/html5/thumbnails/3.jpg)
In a nutshell
• Asset Pipeline• HTTP streaming• JQuery by default• Reversible migrations• Mountable engines• Prepared statements
![Page 4: Rails 3.1 sneak peak](https://reader035.vdocuments.site/reader035/viewer/2022062513/5550d7afb4c905e8318b5126/html5/thumbnails/4.jpg)
In a nutshell
• Rack::Cache on by default• Turn test-output on Ruby 1.9• Force SSL• Role-based mass-assignment
protection• BCrypt-based passwords• Custom serializers
There's always changelog
![Page 5: Rails 3.1 sneak peak](https://reader035.vdocuments.site/reader035/viewer/2022062513/5550d7afb4c905e8318b5126/html5/thumbnails/5.jpg)
Assets pipeline
• Powered by Sprockets 2.0
Why use Sprockets?
1. Extract reusable code and share it across multiple web sites or applications.
2. Speed up your site by automatically concatenating JavaScript into a single file for production.
3. Organize your JavaScript source code into multiple commented files and directories.
4. Use bleeding-edge framework and library code in your application.
5. Sprockets is compatible with the PDoc JavaScript documentation system and the JavaScript framework of your choice.
![Page 6: Rails 3.1 sneak peak](https://reader035.vdocuments.site/reader035/viewer/2022062513/5550d7afb4c905e8318b5126/html5/thumbnails/6.jpg)
Assets pipeline
• Enables proper organization, including use in plugins and engines
![Page 7: Rails 3.1 sneak peak](https://reader035.vdocuments.site/reader035/viewer/2022062513/5550d7afb4c905e8318b5126/html5/thumbnails/7.jpg)
Assets pipeline
Js plugin example
plugins/color_picker/assets/images/color_picker/arrow.pngplugins/color_picker/assets/images/color_picker/circle.pngplugins/color_picker/assets/images/color_picker/hue.pngplugins/color_picker/assets/images/color_picker/saturation_and_brightness.pngplugins/color_picker/assets/stylesheets/color_picker.cssplugins/color_picker/src/color.jsplugins/color_picker/src/color_picker.js
color_picker.js:
//= require "color"//= provide "../assets"
When <color_picker> is required in your application, its provide directive will tell Sprockets that all files in the plugins/color_picker/assets/ directory should be copied into the web server's document root.
![Page 8: Rails 3.1 sneak peak](https://reader035.vdocuments.site/reader035/viewer/2022062513/5550d7afb4c905e8318b5126/html5/thumbnails/8.jpg)
Assets pipeline
Compiling to one application.js//= require jquery//= require jquery_ujs//= require_tree .//= require 'independent_file'//= require 'super_lib'
![Page 9: Rails 3.1 sneak peak](https://reader035.vdocuments.site/reader035/viewer/2022062513/5550d7afb4c905e8318b5126/html5/thumbnails/9.jpg)
Assets pipeline
“CoffeeScript is well done and more convenient to use
than JavaScript”- Brendan Eich, inventor of JavaScript
![Page 10: Rails 3.1 sneak peak](https://reader035.vdocuments.site/reader035/viewer/2022062513/5550d7afb4c905e8318b5126/html5/thumbnails/10.jpg)
Assets pipeline
CoffeeScript
• Ruby-like syntax• Doesn't deprecate JavaScript code• OOP made easy (extends, etc)• Arrays with slicing and generators• Strings with interpolation and multi-line
![Page 11: Rails 3.1 sneak peak](https://reader035.vdocuments.site/reader035/viewer/2022062513/5550d7afb4c905e8318b5126/html5/thumbnails/11.jpg)
Assets pipeline
CoffeeScript
![Page 12: Rails 3.1 sneak peak](https://reader035.vdocuments.site/reader035/viewer/2022062513/5550d7afb4c905e8318b5126/html5/thumbnails/12.jpg)
Assets pipeline
CoffeeScript
http://asciicasts.com/episodes/267-coffeescript-basics
![Page 13: Rails 3.1 sneak peak](https://reader035.vdocuments.site/reader035/viewer/2022062513/5550d7afb4c905e8318b5126/html5/thumbnails/13.jpg)
Assets pipeline
SASS
• Nesting• Variables• Mixins
![Page 14: Rails 3.1 sneak peak](https://reader035.vdocuments.site/reader035/viewer/2022062513/5550d7afb4c905e8318b5126/html5/thumbnails/14.jpg)
Reversible migrations
![Page 15: Rails 3.1 sneak peak](https://reader035.vdocuments.site/reader035/viewer/2022062513/5550d7afb4c905e8318b5126/html5/thumbnails/15.jpg)
Basic Auth
![Page 16: Rails 3.1 sneak peak](https://reader035.vdocuments.site/reader035/viewer/2022062513/5550d7afb4c905e8318b5126/html5/thumbnails/16.jpg)