Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing the examples for button_to

The examples do not generate the output they intend to due to not explicitly declaring the hash separations. This causes it to be treated as one parameter instead of the intended two parameters.
  • Loading branch information...
commit 741b291d660b298c0e39ce15e266f7d2cdfa8e2d 1 parent 7290fb2
@mbaumbach mbaumbach authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 actionpack/lib/action_view/helpers/url_helper.rb
View
4 actionpack/lib/action_view/helpers/url_helper.rb
@@ -241,13 +241,13 @@ def link_to(name = nil, options = nil, html_options = nil, &block)
# # </div>
# # </form>"
#
- # <%= button_to "New", action: "new", form_class: "new-thing" %>
+ # <%= button_to "New", { action: "new" }, form_class: "new-thing" %>
# # => "<form method="post" action="/controller/new" class="new-thing">
# # <div><input value="New" type="submit" /></div>
# # </form>"
#
#
- # <%= button_to "Create", action: "create", remote: true, form: { "data-type" => "json" } %>
+ # <%= button_to "Create", { action: "create" }, remote: true, form: { "data-type" => "json" } %>
# # => "<form method="post" action="/images/create" class="button_to" data-remote="true" data-type="json">
# # <div>
# # <input value="Create" type="submit" />
Please sign in to comment.
Something went wrong with that request. Please try again.