Permalink
Browse files

applies API guidelines to example

  • Loading branch information...
1 parent 3223e04 commit f9472f064fae12d0890075d698d8e5fd81289392 @fxn fxn committed Mar 24, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 actionpack/lib/action_view/helpers/javascript_helper.rb
@@ -121,8 +121,8 @@ def button_to_function(name, function='', html_options={})
# The +href+ attribute of the tag is set to "#" unles +html_options+ has one.
#
# link_to_function "Greeting", "alert('Hello world!')", :class => "nav_link"
- # Produces:
- # <a onclick="alert('Hello world!'); return false;" href="#" class="nav_link">Greeting</a>
+ # # => <a class="nav_link" href="#" onclick="alert('Hello world!'); return false;">Greeting</a>
+ #
def link_to_function(name, function, html_options={})
onclick = "#{"#{html_options[:onclick]}; " if html_options[:onclick]}#{function}; return false;"
href = html_options[:href] || '#'

0 comments on commit f9472f0

Please sign in to comment.