Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Dont repeat the button_to method
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3425 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Jan 16, 2006
1 parent 4793a2f commit e87c4f0
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions actionpack/lib/action_view/helpers/javascript_helper.rb
Expand Up @@ -72,20 +72,6 @@ def button_to_function(name, function, html_options = {})
}))
end

# 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(); }")
def button_to_function(name, function, html_options = {})
html_options.symbolize_keys!
tag(:input, html_options.merge({
:type => "button", :value => name,
:onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + "#{function};"
}))
end

# Includes the Action Pack JavaScript libraries inside a single <script>
# tag. The function first includes prototype.js and then its core extensions,
# (determined by filenames starting with "prototype").
Expand Down

0 comments on commit e87c4f0

Please sign in to comment.