Guest User

Untitled

a guest
Feb 21st, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. Index: action_controller/caching.rb
  2. ===================================================================
  3. --- action_controller/caching.rb (revision 5487)
  4. +++ action_controller/caching.rb (working copy)
  5. @@ -330,7 +330,7 @@
  6. def cache_erb_fragment(block, name = {}, options = nil)
  7. unless perform_caching then block.call; return end
  8.  
  9. - buffer = eval("_erbout", block.binding)
  10. + buffer = eval(ActionView::Base.erb_variable, block.binding)
  11.  
  12. if cache = read_fragment(name, options)
  13. buffer.concat(cache)
  14. Index: action_view/helpers/text_helper.rb
  15. ===================================================================
  16. --- action_view/helpers/text_helper.rb (revision 5487)
  17. +++ action_view/helpers/text_helper.rb (working copy)
  18. @@ -23,7 +23,7 @@
  19. # is equivalent to using:
  20. # <%= "hello" %>
  21. def concat(string, binding)
  22. - eval("_erbout", binding).concat(string)
  23. + eval(ActionView::Base.erb_variable, binding).concat(string)
  24. end
  25.  
  26. # If +text+ is longer than +length+, +text+ will be truncated to the length of
  27. Index: action_view/helpers/capture_helper.rb
  28. ===================================================================
  29. --- action_view/helpers/capture_helper.rb (revision 5487)
  30. +++ action_view/helpers/capture_helper.rb (working copy)
  31. @@ -56,15 +56,15 @@
  32. def capture(*args, &block)
  33. # execute the block
  34. begin
  35. - buffer = eval("_erbout", block.binding)
  36. + buffer = eval(ActionView::Base.erb_variable, block.binding)
  37. rescue
  38. buffer = nil
  39. end
  40.  
  41. if buffer.nil?
  42. - capture_block(*args, &block)
  43. + capture_block(*args, &block).to_s
  44. else
  45. - capture_erb_with_buffer(buffer, *args, &block)
  46. + capture_erb_with_buffer(buffer, *args, &block).to_s
  47. end
  48. end
  49.  
  50. @@ -99,7 +99,7 @@
  51. end
  52.  
  53. def capture_erb(*args, &block)
  54. - buffer = eval("_erbout", block.binding)
  55. + buffer = eval(ActionView::Base.erb_variable, block.binding)
  56. capture_erb_with_buffer(buffer, *args, &block)
  57. end
  58.  
  59. Index: action_view/base.rb
  60. ===================================================================
  61. --- action_view/base.rb (revision 5487)
  62. +++ action_view/base.rb (working copy)
  63. @@ -183,6 +183,9 @@
  64. # that alert()s the caught exception (and then re-raises it).
  65. @@debug_rjs = false
  66. cattr_accessor :debug_rjs
  67. +
  68. + @@erb_variable = '_erbout'
  69. + cattr_accessor :erb_variable
  70.  
  71. @@template_handlers = HashWithIndifferentAccess.new
Add Comment
Please, Sign In to add comment