Rails components decoupled from each otherEach component has a clear, published API.
Action dispatch – new – handles: -Request handling and parameter parsing -Sessions, Rails’ flash, and cookie storage -File uploads -Routing, URL matching, and rescuing errors -HTTP conditional GETs -Client response and HTTP status code
AbstractController Base: rendering, layouts, managing template pathsActionController Metal: exposes Rack endpointsActionController Base: like the rails2 one.
If you’re mistakenly using rails2 – you’ll end up with an app called ‘new’.
rake db:createrails srails g controller home indexrails g scaffold Post name:stringtitle:stringcontent:text
environment.rb – much simplerapplication.rb – new!config.ru – yes, it’s a rack app
Old style still works in rails3
Makes named routes more obvious
Rails 3 example from http://guides.rails.info/getting_started.html:root :to => "home#index"
Still works – just ugly
rails g mailer UserMailer welcome forgot_passwordCreates user_mailer in app/mailers
Rails2 find used to query the database.Rails3 returns an ActiveRecord::Relation – only queried when you do @posts.eachThe .all on the last query, forces the query to be evaluated, and so returns an array. Without it, you’d get an ActiveRelation object.