aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-03-25 00:30:29 +0100
committerXavier Noria <fxn@hashref.com>2011-04-13 13:23:16 +0200
commitf9472f064fae12d0890075d698d8e5fd81289392 (patch)
tree2336bce6c5815bf451a5eccbb91a4130266bbe26 /actionpack/lib/action_view/helpers
parent3223e04a21c27a2e612fcd341e06c46433659f8d (diff)
downloadrails-f9472f064fae12d0890075d698d8e5fd81289392.tar.gz
rails-f9472f064fae12d0890075d698d8e5fd81289392.tar.bz2
rails-f9472f064fae12d0890075d698d8e5fd81289392.zip
applies API guidelines to example
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/javascript_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb
index 136d006ad1..5a1d07fd24 100644
--- a/actionpack/lib/action_view/helpers/javascript_helper.rb
+++ b/actionpack/lib/action_view/helpers/javascript_helper.rb
@@ -121,8 +121,8 @@ module ActionView
# 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] || '#'