Permalink
Browse files

fix for javascript_helper.rb build_callbacks #893

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@970 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent c006bae commit 0cb18335d9108c0c2d7796257446ad3741661939 @dhh dhh committed Mar 21, 2005
Showing with 5 additions and 3 deletions.
  1. +5 −3 actionpack/lib/action_view/helpers/javascript_helper.rb
View
8 actionpack/lib/action_view/helpers/javascript_helper.rb
@@ -169,9 +169,11 @@ def build_observer(klass, name, options = {})
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

0 comments on commit 0cb1833

Please sign in to comment.