Skip to content

Instantly share code, notes, and snippets.

@heidmotron
Created April 21, 2009 18:54
Show Gist options
  • Save heidmotron/99318 to your computer and use it in GitHub Desktop.
Save heidmotron/99318 to your computer and use it in GitHub Desktop.
# Existing
action = url_for(:action => options[:action], :id => record)
# action should be the result of url_for which would be a string
# then it gets shoved into a hash where url_for will get called once again
contents = form_tag({:action => action}, :method =>(options[:method] || 'post'), :enctype => options[:multipart] ? 'multipart/form-data': nil)
# The patch
action = {:action => options[:action], :id => record}
# Let url_for handle it in the form_tag method
contents = form_tag(action, :method =>(options[:method] || 'post'), :enctype => options[:multipart] ? 'multipart/form-data': nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment