rails 3.1 awesomeness - what's new

17
Rails 3.1 awesomeness for roro Sydney Meet-up May 2011 Steven Ringo [email protected] Ryan Bigg [email protected]

Upload: dynamic-clarity

Post on 19-May-2015

3.713 views

Category:

Education


1 download

DESCRIPTION

Steven Ringo from Dynamic Clarity and Ryan Bigg from RubyX presents what's new in Rails 3.1 for Ruby on Rails Oceania's Sydney Meet-up for May 2011.

TRANSCRIPT

Page 1: Rails 3.1 Awesomeness - what's new

Rails 3.1 awesomenessfor roro Sydney Meet-up May 2011

Steven [email protected]

Ryan Bigg [email protected]

Page 2: Rails 3.1 Awesomeness - what's new

http://www.flickr.com/photos/23611308@N03/4252962768/

Page 3: Rails 3.1 Awesomeness - what's new

massive

Page 4: Rails 3.1 Awesomeness - what's new

see full list athttps://gist.github.com/958283

*thanks to Ryan Bates for the list

Page 5: Rails 3.1 Awesomeness - what's new

jQuery new default

jquery-rails gemprototype-rails gem

Page 6: Rails 3.1 Awesomeness - what's new

Sass (scss) is a first-class citizen

wtf is sass?

see also compass:http://compass-style.org/reference/compass/

Page 7: Rails 3.1 Awesomeness - what's new

asset packaging

Page 8: Rails 3.1 Awesomeness - what's new

CoffeeScript

Compiles to JavaScript

Ruby-like syntactic sugar to enhance JS

Array comprehension and pattern matching

Don’t freak out, its not mandatory

Page 9: Rails 3.1 Awesomeness - what's new

in-memory cache to preventduplicate retrieval of the same object data from the

database

Identity Map

Page 10: Rails 3.1 Awesomeness - what's new

HTTP Streaming

http://en.wikipedia.org/wiki/Manneken_Pis

Page 11: Rails 3.1 Awesomeness - what's new

classic asp had this in 1997: <%response.Buffer=true%>

a.k.a. chunked transfer encoding

send content to the browser before the serveris finished processing

http://weblog.rubyonrails.org/2011/4/18/why-http-streaming

ostensibly faster page loads

Page 12: Rails 3.1 Awesomeness - what's new

ActiveModel::SecurePassword

B

Page 13: Rails 3.1 Awesomeness - what's new

ActiveModel::SecurePassword

BCrypt = brute force resistant

Can be made slower... (Moore’s law)

class User < ActiveRecord::Base has_secure_passwordend

Page 14: Rails 3.1 Awesomeness - what's new

Migration system will figure out how to reverse your migration.

Instance methods, not class methods.

Reversible Migrations Reversible Migrations

class MyMigration < ActiveRecord::Migration def change create_table(:horses) do t.column :content, :text t.column :remind_at, :datetime end endend

Page 15: Rails 3.1 Awesomeness - what's new

Mass assignment with roles

class Post < ActiveRecord::Base attr_accessible :title attr_accessible :title, :published_at, :as => :adminend

Post.new(params[:post], :as => :admin)

Page 16: Rails 3.1 Awesomeness - what's new

Railscasts on 3.1 ep #26510/5/2011

Page 17: Rails 3.1 Awesomeness - what's new