class Temple::Generators::RailsOutputBuffer

Implements a rails output buffer.

@output_buffer = ActionView::OutputBuffer
@output_buffer.safe_concat "static"
@output_buffer.safe_concat dynamic.to_s
@output_buffer

@api public

Public Instance Methods

concat(str) click to toggle source
# File lib/temple/generators.rb, line 129
def concat(str)
  "#{buffer}.safe_concat((#{str}))"
end
preamble() click to toggle source
# File lib/temple/generators.rb, line 121
def preamble
  if options[:streaming] && options[:buffer] == '@output_buffer'
    "#{buffer} = output_buffer || #{options[:buffer_class]}.new"
  else
    "#{buffer} = #{options[:buffer_class]}.new"
  end
end