Wed Dec 05 18:15:00 UTC 2007
rails inserts heinous html sometimes
Using button_to in rails inserts unnecessary div tags into your html and i recommend using the following override code in your application helper.def button_to(value, link, options={})
if not options.empty?
return super(value, link, options)
end
return "<input type=\"button\" value=\"#{value}\" onclick=\"location.href='#{url_for(link)}'\"/>"
end
That way you get clean return values like
<input value="Submit" onclick="http://yoururl.com" />
rather than getting:
<div> <form method="post" action="http://yoururl.com" class="button-to"><div><input type="submit" value="Publish it" /></div></form> </div>
However this doesn't solve the method post problem

Sorry, comments are closed for this article.