1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

fix for javascript_helper.rb build_callbacks #893

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@970 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-03-21 23:41:25 +00:00
parent c006bae4b8
commit 0cb18335d9

View file

@ -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