diff options
author | Xavier Noria <fxn@hashref.com> | 2011-03-25 00:30:29 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-04-13 13:23:16 +0200 |
commit | f9472f064fae12d0890075d698d8e5fd81289392 (patch) | |
tree | 2336bce6c5815bf451a5eccbb91a4130266bbe26 /actionpack | |
parent | 3223e04a21c27a2e612fcd341e06c46433659f8d (diff) | |
download | rails-f9472f064fae12d0890075d698d8e5fd81289392.tar.gz rails-f9472f064fae12d0890075d698d8e5fd81289392.tar.bz2 rails-f9472f064fae12d0890075d698d8e5fd81289392.zip |
applies API guidelines to example
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/helpers/javascript_helper.rb | 4 |
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] || '#' |