diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-21 23:41:25 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-21 23:41:25 +0000 |
commit | 0cb18335d9108c0c2d7796257446ad3741661939 (patch) | |
tree | 7b80dd3918b8d23d665c211767f500d50e486f95 /actionpack | |
parent | c006bae4b8e0b44fccbd43e2982428aabdeb538e (diff) | |
download | rails-0cb18335d9108c0c2d7796257446ad3741661939.tar.gz rails-0cb18335d9108c0c2d7796257446ad3741661939.tar.bz2 rails-0cb18335d9108c0c2d7796257446ad3741661939.zip |
fix for javascript_helper.rb build_callbacks #893
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@970 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/helpers/javascript_helper.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index 569f3ff194..3de110428f 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -169,9 +169,11 @@ module ActionView def build_callbacks(options) CALLBACKS.inject({}) do |callbacks, callback| - name = 'on' + callback.to_s.capitalize - code = escape_javascript(options[callback]) - callbacks[name] = "function(request){#{code}}" if callbacks[name] + if options[callback] + name = 'on' + callback.to_s.capitalize + code = escape_javascript(options[callback]) + callbacks[name] = "function(request){#{code}}" + end callbacks end end |