Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
# this works: def test_link(name, options = {}, html_options = nil) url = url_for(options[:url]) "<form id='k' method='post' action=\"#{url}\">" + "<input id='value' type='hidden' name='value' value="'Foooo'"></form>"+ "<input class='btn_save' onclick=\"$('k').submit();\" type='button'/>" end # but i want something like this: def test_link(name, options = {}, html_options = nil) onclick = "var f = document.createElement('form');"+ "f.style.display = 'none'; this.parentNode.appendChild(f);"+ "f.method = 'POST'; f.action = '/typ/foo'; f.id='k';"+ "var i = createElement('input'); i.type='hidden'; i.value='Foooo'; i.name='value';"+ "document.write(<input id='value' type='hidden' name='name' value='Fooo'/>);"+ "f.submit(); return false;" "<input class='btn_save' onclick=\"#{onclick}\" type='button'/>" end # but this doesn' work...
This paste will be private.
From the Design Piracy series on my blog: