diff options
author | Attila Domokos <adomokos@gmail.com> | 2014-02-02 10:27:18 -0600 |
---|---|---|
committer | Attila Domokos <adomokos@gmail.com> | 2014-02-02 10:27:18 -0600 |
commit | 4b4db54e6b48813b24c807b0156eb58bc4694cd9 (patch) | |
tree | 89cb8a8129ccddc036fb396471c96a4bc7a5abf7 /actionview/lib/action_view/helpers/url_helper.rb | |
parent | 4ac114471cc14de44b77ced3dd4a0676c13b818b (diff) | |
download | rails-4b4db54e6b48813b24c807b0156eb58bc4694cd9.tar.gz rails-4b4db54e6b48813b24c807b0156eb58bc4694cd9.tar.bz2 rails-4b4db54e6b48813b24c807b0156eb58bc4694cd9.zip |
Adding an documentation example and a test to button_to with path
I did not see in the docs that `button_to` supports not only URLs but paths as well. I documented this functionality with a unit tests and added an example to the docs as well.
Diffstat (limited to 'actionview/lib/action_view/helpers/url_helper.rb')
-rw-r--r-- | actionview/lib/action_view/helpers/url_helper.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionview/lib/action_view/helpers/url_helper.rb b/actionview/lib/action_view/helpers/url_helper.rb index 56dd7a4390..3ccace1274 100644 --- a/actionview/lib/action_view/helpers/url_helper.rb +++ b/actionview/lib/action_view/helpers/url_helper.rb @@ -232,6 +232,11 @@ module ActionView # # <div><input value="New" type="submit" /></div> # # </form>" # + # <%= button_to "New", new_articles_path %> + # # => "<form method="post" action="/articles/new" class="button_to"> + # # <div><input value="New" type="submit" /></div> + # # </form>" + # # <%= button_to [:make_happy, @user] do %> # Make happy <strong><%= @user.name %></strong> # <% end %> |