This project is archived and is in readonly mode.

#1225 ✓invalid
Ted Kulp

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

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

Pages