Browse files

Rails 4.0 release notes. Explain major features added and removed. [c…

…i skip]
  • Loading branch information...
1 parent eda66d8 commit 60cca3b0619e69ce0b1086fc1433adbd8b7d11c5 @mking mking committed Jul 20, 2013
Showing with 39 additions and 2 deletions.
  1. +39 −2 guides/source/
@@ -50,10 +50,47 @@ $ ruby /path/to/rails/railties/bin/rails new myapp --dev
Major Features
-TODO. Give a list and then talk about each of them briefly. We can point to relevant code commits or documentation from these sections.
[![Rails 4.0](images/rails4_features.png)](
+### Upgrade
+ * **Ruby 1.9.3** ([commit]( - Ruby 2.0 preferred; 1.9.3+ required
+ * **[New deprecation policy](** - Deprecated features are warnings in Rails 4.0 and will be removed in Rails 4.1.
+ * **ActionPack page and action caching** ([commit]( - Page and action caching are extracted to a separate gem. Page and action caching requires too much manual intervention (manually expiring caches when the underlying model objects are updated). Instead, use Russian doll caching.
+ * **ActiveRecord observers** ([commit]( - Observers are extracted to a separate gem. Observers are only needed for page and action caching, and can lead to spaghetti code.
+ * **ActiveRecord session store** ([commit]( - The ActiveRecord session store is extracted to a separate gem. Storing sessions in SQL is costly. Instead, use cookie sessions, memcache sessions, or a custom session store.
+ * **ActiveModel mass assignment protection** ([commit]( - Rails 3 mass assignment protection is deprecated. Instead, use strong parameters.
+ * **ActiveResource** ([commit]( - ActiveResource is extracted to a separate gem. ActiveResource was not widely used.
+ * **vendor/plugins removed** ([commit]( - Use a Gemfile to manage installed gems.
+### ActionPack
+ * **Strong parameters** ([commit]( - Only allow whitelisted parameters to update model objects (`params.permit(:title, :text)`).
+ * **Routing concerns** ([commit]( - In the routing DSL, factor out common subroutes (`comments` from `/posts/1/comments` and `/videos/1/comments`).
+ * **ActionController::Live** ([commit]( - Stream JSON with ``.
+ * **Declarative ETags** ([commit]( - Set ETag and Last-Modified headers using `etag` and `fresh_when`.
+ * **[Russian doll caching](** ([commit]( - Cache nested fragments of views. Each fragment expires based on a set of dependencies (a cache key). The cache key is usually a template version number and a model object.
+ * **Turbolinks** ([commit]( - Serve only one initial HTML page. When the user navigates to another page, use pushState to update the URL and use AJAX to update the title and body.
+ * **Decouple ActionView from ActionController** ([commit]( - ActionView is moved outside of ActionPack.
+ * **Do not depend on ActiveModel** ([commit]( - ActionPack no longer depends on ActiveModel.
+### General
+ * **ActiveModel::Model** ([commit]( - `ActiveModel::Model` is extracted from ActiveRecord. `ActiveModel::Model` provides validations and `form_for` for normal Ruby objects.
+ * **New scope API** ([commit]( - Scopes must always use callables.
+ * **Schema cache dump** ([commit]( - To improve Rails boot time, instead of loading the schema directly from the database, load the schema from a dump file.
+ * **Support for specifying transaction isolation level** ([commit]( - Choose whether repeatable reads or improved performance (less locking) is more important.
+ * **Dalli** ([commit]( - For the memcache session store, use the Dalli memcache client.
+ * **Notifications start & finish** ([commit]( - Active Support instrumentation reports start and finish notifications to subscribers.
+ * **Thread safe by default** ([commit]( - Rails can run in threaded app servers without additional configuration. Note: Check that the gems you are using are threadsafe.
+ * **PATCH verb** ([commit]( - In Rails, PATCH replaces PUT. PATCH is used for partial updates of resources.
+### Security
+ * **match do not catch all** ([commit]( - In the routing DSL, match requires the HTTP verb or verbs to be specified.
+ * **html entities escaped by default** ([commit]( - Strings rendered in erb are escaped unless wrapped with `raw` or `html_safe` is called.
+ * **New security headers** ([commit]( - Rails sends the following headers with every HTTP request: `X-Frame-Options` (prevents clickjacking by forbidding the browser from embedding the page in a frame), `X-XSS-Protection` (asks the browser to halt script injection) and `X-Content-Type-Options` (prevents the browser from opening a jpeg as an exe).
Extraction of features to gems

0 comments on commit 60cca3b

Please sign in to comment.