haml-edge 2.3.239 → 2.3.240
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/EDGE_GEM_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/haml/helpers/action_view_mods.rb +16 -0
- data/test/haml/template_test.rb +11 -0
- metadata +1 -1
data/EDGE_GEM_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.3.
|
|
1
|
+
2.3.240
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.3.
|
|
1
|
+
2.3.240
|
|
@@ -169,6 +169,22 @@ module ActionView
|
|
|
169
169
|
alias_method :form_for_without_haml, :form_for
|
|
170
170
|
alias_method :form_for, :form_for_with_haml
|
|
171
171
|
end
|
|
172
|
+
|
|
173
|
+
module CacheHelper
|
|
174
|
+
# This is a workaround for a Rails 3 bug
|
|
175
|
+
# that's present at least through beta 3.
|
|
176
|
+
# Their fragment_for assumes that the block
|
|
177
|
+
# will return its contents as a string,
|
|
178
|
+
# which is not always the case.
|
|
179
|
+
# Luckily, it only makes this assumption if caching is disabled,
|
|
180
|
+
# so we only override that case.
|
|
181
|
+
def fragment_for_with_haml(*args, &block)
|
|
182
|
+
return fragment_for_without_haml(*args, &block) if controller.perform_caching
|
|
183
|
+
capture(&block)
|
|
184
|
+
end
|
|
185
|
+
alias_method :fragment_for_without_haml, :fragment_for
|
|
186
|
+
alias_method :fragment_for, :fragment_for_with_haml
|
|
187
|
+
end
|
|
172
188
|
else
|
|
173
189
|
module FormTagHelper
|
|
174
190
|
def form_tag_with_haml(url_for_options = {}, options = {}, *parameters_for_url, &proc)
|
data/test/haml/template_test.rb
CHANGED
|
@@ -401,6 +401,17 @@ window.location.reload();
|
|
|
401
401
|
HTML
|
|
402
402
|
= update_page do |p|
|
|
403
403
|
- p.reload
|
|
404
|
+
HAML
|
|
405
|
+
end
|
|
406
|
+
|
|
407
|
+
def test_cache
|
|
408
|
+
@base.controller = ActionController::Base.new
|
|
409
|
+
@base.controller.perform_caching = false
|
|
410
|
+
assert_equal(<<HTML, render(<<HAML, :action_view))
|
|
411
|
+
Test
|
|
412
|
+
HTML
|
|
413
|
+
- cache do
|
|
414
|
+
Test
|
|
404
415
|
HAML
|
|
405
416
|
end
|
|
406
417
|
end
|