• Uses pushState to reload the whole body. • Like PJAX, also replaces the <title> tag. • Default in Rails 4, enabled for every link. • Already available in 3.2.8 : https://github.com/rails/turbolinks
can opt-out on a per-link basis : It does not trigger the document.ready event in JS, so we'd have to also bind relevant code to page.change, like so : $(function() { initPage(); }); $(window).bind('page.change', function() { initPage(); }); link_to "Awesome home page", root_path, data: { no-turbolinks: true }
that responds to #run. Class UserMailJob < Struct.new(:user_id) def run user = User.find(user_id) UserMailer.welcome(user).deliver end end # In users_controller.rb Rails.queue.push UserMailJob.new(@user.id)
the controller. Also works for nested resources. class UsersController def create User.create(user_params) end private def user_params params.require(:user). permit(:email, :name) end end
template and all its dependencies. • Works implicitly for most rendering cases. • Can also be called explicitly with a comment. <%# Template Dependency: users/comment %> • Available already in 3.2.8 : https://github.com/rails/cache_digests
Relation.all Always returns a ActiveRecord::Relation object. • Relation.none Returns a ActiveRecord::NullRelation, for those cases you would return an empty array.
finders (User.find(:all)) • Scopes are no longer eager-evaluated, need a lambda. • AR::SessionStore, ActiveRessource extracted as gems. • Rails 2-style plugins are completely removed (finally!)
Rails 4. https://speakerdeck.com/u/bostonrb/p/what-to-expect-in-rails-4-dot-0 Video on Rails Queues by Caike Souza http://www.codeschool.com/code_tv/rails-4-queues A Fresh cup : weekly follow-up of the changes in Rails master. http://afreshcup.com/ Further reading