The javascript module is accessible via the webhelpers.rails module.
Provides functionality for working with JavaScript in your views.
Returns a link that'll trigger a JavaScript function using the onclick handler and return false after the fact.
Example:
link_to_function("Greeting", "alert('Hello world!')")
Returns a link that'll trigger a JavaScript function using the onclick handler and return false after the fact.
Example:
button_to_function("Greeting", "alert('Hello world!')")
Escape carriage returns and single and double quotes for JavaScript segments.
Returns a JavaScript tag with the content inside.
Example:
>>> javascript_tag("alert('All is good')")
'<script type="text/javascript">\n//<![CDATA[\nalert(\'All is good\')\n//]]>\n</script>'
See the source for more information.