This project is archived and is in readonly mode.
button_to shows wrong method
Reported by Ted Kulp | October 16th, 2008 @ 01:16 PM | in 2.x
When using button_to for a standard get or post, it will instead return method="true" instead of method="post". I'm using rails 2.1.1 downloaded via gem and code in github looks like it hasn't changed.
Code used:
<%= button_to('Remove', {:action => 'remove_from_project', :id => @project.id, :assignment_id => assignment.id}, :confirm => 'Are you sure you want to remove this user from the project?') -%>
Produced:
<form method="true" action="/project/remove_from_project/6?assignment_id=2" class="button-to"><div><input onclick="return confirm('Are you sure you want to remove this user from the project?');" type="submit" value="Remove" /></div></form>
Adding a :method => 'post' at various points doesn't do anything. My hunch is that it's something to do with the tertiary there... maybe it needs to be wrapped in (). Or it's related to "method" being used instead of "method_tag" at one point.
Please let me know if you need any other information or help testing. If I am doing something wrong in my code, I apologize for the false report.
Thanks!
Comments and changes to this ticket
-
Gabriel Medina October 18th, 2008 @ 11:41 AM
Hi, I checked this bug, but can't reproduce ...
Exactly same code produces (correctly):
Could you double check the version of rails you're using and if possible button_to definition in rails/actionpack/lib/action_view/helpers/url_helper.rb?
Thanks,
-
Gabriel Medina October 18th, 2008 @ 11:46 AM
Code again .... >:| @@@html <form method="post" action="/main/remove_from_project/777?assignment_id=7777" class="button-to"><div><input onclick="return confirm('Are you sure you want to remove this user from the project?');" type="submit" value="Remove" /><input name="authenticity_token" type="hidden" value="d1e8628fb742d85f62ae1e9c7a789e2e99281be3" /></div></form>
Here's a pastie just in case [Output for button_to](http://www.pastie.org/295221 "Output for button_to")
-
Gabriel Medina October 18th, 2008 @ 11:48 AM
<form method="post" action="/main/remove_from_project/777?assignment_id=7777" class="button-to"><div><input onclick="return confirm('Are you sure you want to remove this user from the project?');" type="submit" value="Remove" /><input name="authenticity_token" type="hidden" value="d1e8628fb742d85f62ae1e9c7a789e2e99281be3" /></div></form>
-
Pratik January 18th, 2009 @ 09:01 PM
- State changed from new to invalid
Works for me. Please submit a failing test if it's still an issue.
Thanks.
-
Repository August 9th, 2009 @ 04:13 PM
(from [5e4b9469279ea798470ae33c5c0c4cdc503bada6]) Fixed the end_of_* to work with Time.usec (and Time.nsec in ruby1.9) [#1225 status:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/5e4b9469279ea798470ae33c5c0c4c...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Referenced by
- 1225 button_to shows wrong method (from [5e4b9469279ea798470ae33c5c0c4cdc503bada6]) Fixed t...