Skip to content

Instantly share code, notes, and snippets.

@josepjaume
Created January 25, 2011 09:14
Show Gist options
  • Save josepjaume/794694 to your computer and use it in GitHub Desktop.
Save josepjaume/794694 to your computer and use it in GitHub Desktop.
Replaces input type="submit" form elements with button
module ActionView
module Helpers
def submit_tag(value = "Save changes", options = {})
options.stringify_keys!
if disable_with = options.delete("disable_with")
options["data-disable-with"] = disable_with
end
if confirm = options.delete("confirm")
options["data-confirm"] = confirm
end
content_tag :button, value, { "type" => "submit", "name" => "commit"}.update(options.stringify_keys)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment