> > I mean fragment caching. I get errors like this:
> >
> > ActionView::TemplateError
> >
(/usr/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:192:in> > `method_missing'': no such method `length'') on line
#0> > of app/views/items/index.mab:
> > 1:
> > 2: cache("#{@site.server_name}/index_items") do
> >
> >
> > Joe
>
> Yep, the length error is because a lot of Rails''
internals still> assume ERB, which uses a different buffer structure
to Markaby. I''ll> try to get it working soon.
>
> Cheers,
> Tim
Do you have any ideas how to approach it? Looking at
Rails'' code:
# Called by CacheHelper#cache
def cache_erb_fragment(block, name = {}, options
= nil)
unless perform_caching then block.call; return
end
buffer = eval("_erbout", block.binding)
if cache = read_fragment(name, options)
buffer.concat(cache)
else
pos = buffer.length
block.call
write_fragment(name, buffer[pos..-1],
options)
end
end
It seems like Markaby might have to have a "length"
attribute and/or act like "buffer"? Or would Rails
need to be changed on the eval line?
Joe
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com