mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
commit
32dd37b65a
1 changed files with 17 additions and 13 deletions
|
@ -176,9 +176,14 @@ module ActionView
|
||||||
|
|
||||||
# TODO: Create an object that has caching read/write on it
|
# TODO: Create an object that has caching read/write on it
|
||||||
def fragment_for(name = {}, options = nil, &block) #:nodoc:
|
def fragment_for(name = {}, options = nil, &block) #:nodoc:
|
||||||
if fragment = controller.read_fragment(name, options)
|
read_fragment_for(name, options) || write_fragment_for(name, options, &block)
|
||||||
fragment
|
end
|
||||||
else
|
|
||||||
|
def read_fragment_for(name, options) #:nodoc:
|
||||||
|
controller.read_fragment(name, options)
|
||||||
|
end
|
||||||
|
|
||||||
|
def write_fragment_for(name, options) #:nodoc:
|
||||||
# VIEW TODO: Make #capture usable outside of ERB
|
# VIEW TODO: Make #capture usable outside of ERB
|
||||||
# This dance is needed because Builder can't use capture
|
# This dance is needed because Builder can't use capture
|
||||||
pos = output_buffer.length
|
pos = output_buffer.length
|
||||||
|
@ -193,4 +198,3 @@ module ActionView
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
Loading…
Reference in a new issue