Gabe Kopley
www.railsschool.org/l/rails-4-new-features
-
Cache digests
-
ActionController::Live
-
Strong parameters
-
Turbolinks
(tested with 1ce304f8165e4a930f1a8fb1f6706e61f6411096)
$ gem install bundler --pre
$ gem install i18n thor thread_safe
$ git clone git://github.com/rails/rails.git
$ rails/railties/bin/rails new <path> --edge
create
create README.rdoc
create Rakefile
...
$ cd <path>
$ bundle exec rails --version
Rails 4.0.0.beta
(Note you must use bundle exec or binstubs because Rubygems doesn't know about gems bundled from git)
-
Automate efficient cache expiration when using nested fragments aka "Russian Doll Caching"
-
Use with Rails 3.2: https://github.com/rails/cache_digests
-
Expire comment fragment when comment template is changed
-
Expire post fragment when the post template or comment template is changed
-
Expire profile fragment when profile template, post template, or comment template is changed
-
(demo)
-
Stream data to client with utmost flexibility
-
Unlike other new features, this one is not packaged for use with Rails 3.2
-
(demo)
-
New mechanism for mass assignment control.
-
No more
attr_accessible
in models. Instead, strong parameters DSL in controllers. -
Use with Rails 3.2: https://github.com/rails/strong_parameters
- Rails < 3.2.3 allowed mass assignment of arbitrary attributes by default
- @homakov calls attention to security implications of this behavior - rails/rails#5228
- Rails committers close @homakov's ticket for various reasons.
- @homakov discovers and exploits vulnerability in GitHub caused by Rails' default behavior - https://github.com/rails/rails/commit/b839657
- Rails team rushes to ship point release that prohibits mass assignment of attributes by default (Rails 3.2.3)
- @wycats proposes Improving Mass Assignment, provokes discussion.
- @dhh releases https://github.com/rails/strong_parameters
Strong Parameters screencast by RailsCasts Pro
-
A little javascript avoids full page reloads when following links, providing more responsive experience to users.
-
Use with Rails 3.2: https://github.com/rails/turbolinks
-
Seriously. Numbers. Use them. by Steve Klabnik
-
(demo)
(demo)
.all
returns relation#update_columns
introducedRelation#none
introducedRelation#not
introducedRelation#first
andRelation#last
order by idRelation#order
takes a hash of columns and their orders- Bang methods on relations
- Whole bunch of deprecations (eg. many dynamic finders)
- Models don't need to subclass ActiveRecord::Base, can mixin instead
- ...
#collection_checkboxes
#collection_radiobuttons
#date_field
(demo)
-
Prettier
-
Routing errors show routes table
-
(demo)
-
What's New in Rails 4 screen cast by RailsCasts
-
Rails 4: What`s New blog post by Steve Schwartz
-
Rails 4 Whirlwind Tour video presentation by Andy Lindeman