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

Why Should I Care About Rails 4?

Why Should I Care About Rails 4?

A talk about the upcoming features in Rails 4, and where Rails is going.

Steve Klabnik

October 05, 2012
Tweet

More Decks by Steve Klabnik

Other Decks in Programming

Transcript

  1. Mass Extraction ➡page and action caching ➡rack-cache ➡observers ➡session store

    ➡mass assignment ➡active resource Monday, October 8, 12
  2. Strong parameters class PeopleController < ActionController::Base # throws ActiveModel::ForbiddenAttributes exception

    def create Person.create(params[:person]) end private # now it won’t! def person_params params.require(:person).permit(:name, :age) end end Monday, October 8, 12
  3. class MyController < ActionController::Base include ActionController::Live def index 100.times {

    response.stream.write "hello world\n" } response.stream.close end end ActionController::Live Monday, October 8, 12
  4. Routing Concerns BCX::Application.routes.draw do resources :messages { resources :comments }

    resources :forwards { resources :comments } resources :uploads { resources :comments } end BCX::Application.routes.draw do concern :commentable do resources :comments end resources :messages, :forwards, :uploads, concerns: :commentable end Monday, October 8, 12
  5. Turbolinks $(document).ready -> alert "page has loaded!" $(document).bind "page:change", ->

    alert "page has loaded!" <a href="..." data-no-turbolink> No turbolinks here </a>. Monday, October 8, 12
  6. • 4.0.0: Easy upgrade, new features, new deprecations • 4.0.x:

    no new deprecations • 4.1.0: add features, remove deprecated stuff Monday, October 8, 12
  7. “But what distinguishes the worst architect from the best of

    bees is this, that the architect raises his structure in imagination before he erects it in reality. ... Besides the exertion of the bodily organs, the process demands that, during the whole operation, the workman’s will be steadily in consonance with his purpose. This means close attention.” - Marx, Capital I, Chapter 7 Monday, October 8, 12