Skip to content

Instantly share code, notes, and snippets.

@paulanthonywilson
Created September 18, 2009 22:33
Show Gist options
  • Save paulanthonywilson/189333 to your computer and use it in GitHub Desktop.
Save paulanthonywilson/189333 to your computer and use it in GitHub Desktop.
def submit_form_javascript name, path, form_name
submission_js = remote_function(:form=>true,
:loading => visual_effect(:appear, 'spinner'),
:complete => visual_effect(:fade, 'spinner', :duration => 0),
:url=>path,
:html=>{:id=>form_name,
:method=>:get})
submission_js.gsub! 'this', "'##{form_name}'"
javascript_tag "#{name} = function() {#{submission_js}}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment