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:
parent
c006bae4b8
commit
0cb18335d9
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue