aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/3_0_release_notes.textile
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-04-05 12:23:42 -0700
committerXavier Noria <fxn@hashref.com>2010-04-05 12:23:42 -0700
commitbb4cf38fa63ea891f0d13f6a43ada692787e2cf3 (patch)
tree48948217226c1125aceff18ddeebfd871f4f61da /railties/guides/source/3_0_release_notes.textile
parent05dd19e21734c81b44a56599131a632da3e9d52b (diff)
downloadrails-bb4cf38fa63ea891f0d13f6a43ada692787e2cf3.tar.gz
rails-bb4cf38fa63ea891f0d13f6a43ada692787e2cf3.tar.bz2
rails-bb4cf38fa63ea891f0d13f6a43ada692787e2cf3.zip
minimal update to 3.0 release notes, will link to CHANGELOGS ultimately
Diffstat (limited to 'railties/guides/source/3_0_release_notes.textile')
-rw-r--r--railties/guides/source/3_0_release_notes.textile26
1 files changed, 26 insertions, 0 deletions
diff --git a/railties/guides/source/3_0_release_notes.textile b/railties/guides/source/3_0_release_notes.textile
index cc84129b35..804ff2a96c 100644
--- a/railties/guides/source/3_0_release_notes.textile
+++ b/railties/guides/source/3_0_release_notes.textile
@@ -302,6 +302,8 @@ More Information:
h4. Action View
+h5. Unobtrusive JavaScript
+
Major re-write was done in the Action View helpers, implementing Unobtrusive JavaScript (UJS) hooks and removing the old inline AJAX commands. This enables Rails to use any compliant UJS driver to implement the UJS hooks in the helpers.
What this means is that all previous <tt>remote_<method></tt> helpers have been removed from Rails core and put into the "Prototype Legacy Helper":http://github.com/rails/prototype_legacy_helper. To get UJS hooks into your HTML, you now pass <tt>:remote => true</tt> instead. For example:
@@ -316,6 +318,22 @@ Produces:
<form action="http://host.com" id="create-post" method="post" data-remote="true">
</html>
+h5. Helpers with Blocks
+
+Helpers like +form_for+ or +div_for+ that insert content from a block use +<%=+ now:
+
+<erb>
+<%= form_for @post do |f| %>
+ ...
+<% end %>
+<erb>
+
+Your own helpers of that kind are expected to return a string, rather than appending to the output buffer by hand.
+
+Helpers that do something else, like +cache+ or +content_for+, are not affected by this change, they need +<%+ as before.
+
+h5. Other Changes
+
* You no longer need to call <tt>h(string)</tt> to escape HTML output, it is on by default in all view templates. If you want the unescaped string, call <tt>raw(string)</tt>.
* Helpers now output HTML 5 by default.
* Form label helper now pulls values from I18n with a single value, so <tt>f.label :name</tt> will pull the <tt>:name</tt> translation.
@@ -382,6 +400,13 @@ class Person < ActiveRecord::Base
end
</ruby>
+There's also support for introspection:
+
+<ruby>
+User.validators
+User.validators_on(:login)
+</ruby>
+
More Information:
* "Sexy Validation in Rails 3":http://thelucid.com/2010/01/08/sexy-validation-in-edge-rails-rails-3/
* "Rails 3 Validations Explained":http://lindsaar.net/2010/1/31/validates_rails_3_awesome_is_true
@@ -512,6 +537,7 @@ These are the main changes in Active Support:
* <tt>MissingSourceFile</tt> exists as a constant but it is now just equals to <tt>LoadError</tt>.
* Added <tt>Class#class_attribute</tt>, to be able to declare a class-level attribute whose value is inheritable and overwritable by subclasses.
* Finally removed +DeprecatedCallbacks+ in <tt>ActiveRecord::Associations</tt>.
+* +Object#metaclass+ is now +Kernel#singleton_class+ to match Ruby.
The following methods have been removed because they are now available in Ruby 1.8.7 and 1.9.