aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb4
-rw-r--r--actionpack/test/template/form_tag_helper_test.rb6
-rw-r--r--actionpack/test/template/url_helper_test.rb14
-rw-r--r--activerecord/lib/active_record/transactions.rb10
-rw-r--r--railties/guides/source/index.html.erb26
-rw-r--r--railties/guides/source/layout.html.erb10
7 files changed, 52 insertions, 20 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index edd7d113a6..4db9c4b84d 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*Rails 3.0.0 [beta 4/release candidate] (unreleased)*
+* OAuth 2: HTTP Token Authorization support to complement Basic and Digest Authorization. [Rick Olson]
+
* Fixed inconsistencies in form builder and view helpers #4432 [Neeraj Singh]
* Both :xml and :json renderers now forwards the given options to the model, allowing you to invoke them as render :xml => @projects, :include => :tasks [José Valim, Yehuda Katz]
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index 4ffc5ea127..210f148c02 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -596,10 +596,8 @@ module ActionView
html_options = {} if html_options.nil?
html_options = html_options.stringify_keys
- if (options.is_a?(Hash) && options.key?('remote')) || (html_options.is_a?(Hash) && html_options.key?('remote'))
+ if (options.is_a?(Hash) && options.key?('remote') && options.delete('remote')) || (html_options.is_a?(Hash) && html_options.key?('remote') && html_options.delete('remote'))
html_options['data-remote'] = 'true'
- options.delete('remote') if options.is_a?(Hash)
- html_options.delete('remote') if html_options.is_a?(Hash)
end
confirm = html_options.delete("confirm")
diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb
index 8756bd310f..abb0e1df93 100644
--- a/actionpack/test/template/form_tag_helper_test.rb
+++ b/actionpack/test/template/form_tag_helper_test.rb
@@ -59,6 +59,12 @@ class FormTagHelperTest < ActionView::TestCase
assert_dom_equal expected, actual
end
+ def test_form_tag_with_remote_false
+ actual = form_tag({}, :remote => false)
+ expected = %(<form action="http://www.example.com" method="post">)
+ assert_dom_equal expected, actual
+ end
+
def test_form_tag_with_block_in_erb
output_buffer = form_tag("http://example.com") { concat "Hello world!" }
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb
index 5120870f50..299d6dd5bd 100644
--- a/actionpack/test/template/url_helper_test.rb
+++ b/actionpack/test/template/url_helper_test.rb
@@ -103,6 +103,13 @@ class UrlHelperTest < ActiveSupport::TestCase
)
end
+ def test_button_to_with_remote_false
+ assert_dom_equal(
+ "<form method=\"post\" action=\"http://www.example.com\" class=\"button_to\"><div><input type=\"submit\" value=\"Hello\" /></div></form>",
+ button_to("Hello", "http://www.example.com", :remote => false)
+ )
+ end
+
def test_button_to_enabled_disabled
assert_dom_equal(
"<form method=\"post\" action=\"http://www.example.com\" class=\"button_to\"><div><input type=\"submit\" value=\"Hello\" /></div></form>",
@@ -205,6 +212,13 @@ class UrlHelperTest < ActiveSupport::TestCase
)
end
+ def test_link_to_with_remote_false
+ assert_dom_equal(
+ "<a href=\"http://www.example.com\">Hello</a>",
+ link_to("Hello", "http://www.example.com", :remote => false)
+ )
+ end
+
def test_link_tag_using_post_javascript
assert_dom_equal(
"<a href='http://www.example.com' data-method=\"post\" rel=\"nofollow\">Hello</a>",
diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb
index 0a55ef2b53..796dd99f02 100644
--- a/activerecord/lib/active_record/transactions.rb
+++ b/activerecord/lib/active_record/transactions.rb
@@ -163,16 +163,16 @@ module ActiveRecord
# === Callbacks
#
# There are two types of callbacks associated with committing and rolling back transactions:
- # after_commit and after_rollback.
+ # +after_commit+ and +after_rollback+.
#
- # The after_commit callbacks are called on every record saved or destroyed within a
- # transaction immediately after the transaction is committed. The after_rollback callbacks
+ # +after_commit+ callbacks are called on every record saved or destroyed within a
+ # transaction immediately after the transaction is committed. +after_rollback+ callbacks
# are called on every record saved or destroyed within a transaction immediately after the
# transaction or savepoint is rolled back.
#
# These callbacks are useful for interacting with other systems since you will be guaranteed
# that the callback is only executed when the database is in a permanent state. For example,
- # after_commit is a good spot to put in a hook to clearing a cache since clearing it from
+ # +after_commit+ is a good spot to put in a hook to clearing a cache since clearing it from
# within a transaction could trigger the cache to be regenerated before the database is updated.
#
# === Caveats
@@ -180,7 +180,7 @@ module ActiveRecord
# If you're on MySQL, then do not use DDL operations in nested transactions
# blocks that are emulated with savepoints. That is, do not execute statements
# like 'CREATE TABLE' inside such blocks. This is because MySQL automatically
- # releases all savepoints upon executing a DDL operation. When #transaction
+ # releases all savepoints upon executing a DDL operation. When +transaction+
# is finished and tries to release the savepoint it created earlier, a
# database error will occur because the savepoint has already been
# automatically released. The following example demonstrates the problem:
diff --git a/railties/guides/source/index.html.erb b/railties/guides/source/index.html.erb
index 52da16d453..5a715cf9f7 100644
--- a/railties/guides/source/index.html.erb
+++ b/railties/guides/source/index.html.erb
@@ -88,10 +88,6 @@ Ruby on Rails Guides
<dl>
-<%= guide("Rails on Rack", 'rails_on_rack.html') do %>
- <p>This guide covers Rails integration with Rack and interfacing with other Rack components.</p>
-<% end %>
-
<%= guide("Rails Internationalization API", 'i18n.html') do %>
<p>This guide covers how to add internationalization to your applications. Your application will be able to translate content to different languages, change pluralization rules, use correct date formats for each country and so on.</p>
<% end %>
@@ -116,10 +112,6 @@ Ruby on Rails Guides
<p>This guide covers the various ways of performance testing a Ruby on Rails application.</p>
<% end %>
-<%= guide("The Basics of Creating Rails Plugins", 'plugins.html', :ticket => 32) do %>
- <p>This guide covers how to build a plugin to extend the functionality of Rails.</p>
-<% end %>
-
<%= guide("Configuring Rails Applications", 'configuring.html') do %>
<p>This guide covers the basic configuration settings for a Rails application.</p>
<% end %>
@@ -137,6 +129,24 @@ Ruby on Rails Guides
<% end %>
</dl>
+<h3>Extending Rails</h3>
+
+<dl>
+ <%= guide("The Basics of Creating Rails Plugins", 'plugins.html', :ticket => 32) do %>
+ <p>This guide covers how to build a plugin to extend the functionality of Rails.</p>
+ <% end %>
+
+ <%= guide("Rails on Rack", 'rails_on_rack.html') do %>
+ <p>This guide covers Rails integration with Rack and interfacing with other Rack components.</p>
+ <% end %>
+
+ <%= guide("Adding Generators", 'generators.html') do %>
+ <p>This guide covers the process of adding a brand new generator to your extension
+ or providing an alternative to an element of a built-in Rails generator (such as
+ providing alternative test stubs for the scaffold generator).</p>
+ <% end %>
+</dl>
+
<h3>Release Notes</h3>
<dl>
diff --git a/railties/guides/source/layout.html.erb b/railties/guides/source/layout.html.erb
index b280101d25..f1727166ba 100644
--- a/railties/guides/source/layout.html.erb
+++ b/railties/guides/source/layout.html.erb
@@ -68,14 +68,16 @@
<dd><a href="security.html">Securing Rails Applications</a></dd>
<dd><a href="debugging_rails_applications.html">Debugging Rails Applications</a></dd>
<dd><a href="performance_testing.html">Performance Testing Rails Applications</a></dd>
- <dd><a href="plugins.html">The Basics of Creating Rails Plugins</a></dd>
<dd><a href="configuring.html">Configuring Rails Applications</a></dd>
- <dd><a href="rails_on_rack.html">Rails on Rack</a></dd>
<dd><a href="command_line.html">Rails Command Line Tools and Rake Tasks</a></dd>
<dd><a href="caching_with_rails.html">Caching with Rails</a></dd>
<dd><a href="contributing_to_rails.html">Contributing to Rails</a></dd>
- </dl>
- <dl class="R">
+
+ <dt>Extending Rails</dt>
+ <dd><a href="plugins.html">The Basics of Creating Rails Plugins</a></dd>
+ <dd><a href="rails_on_rack.html">Rails on Rack</a></dd>
+ <dd><a href="generators.html">Adding a Generator to Your Plugin</a></dd>
+
<dt>Release Notes</dt>
<dd><a href="3_0_release_notes.html">Ruby on Rails 3.0 Release Notes</a></dd>
<dd><a href="2_3_release_notes.html">Ruby on Rails 2.3 Release Notes</a></dd>