Permalink
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...
mbaumbach committed Feb 6, 2013
1 parent 7290fb2 commit 741b291d660b298c0e39ce15e266f7d2cdfa8e2d
Showing with 2 additions and 2 deletions.
  1. +2 −2 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" />

0 comments on commit 741b291

Please sign in to comment.