method

button_to_function

Importance_1
v1.1.6 - Show latest stable - 0 notes - Class: ActionView::Helpers::JavaScriptHelper
button_to_function(name, function, html_options = {}) public

Returns a link that’ll trigger a JavaScript function using the onclick handler.

Examples:

  button_to_function "Greeting", "alert('Hello world!')"
  button_to_function "Delete", "if confirm('Really?'){ do_delete(); }")
Show source
Register or log in to add new notes.