Sha256: 1d02a299233f691f769a4fc8e227d8a0238f88502ff5ff6a5d5a84d54b129893
Contents?: true
Size: 774 Bytes
Versions: 7
Compression:
Stored size: 774 Bytes
Contents
# frozen_string_literal: true module WebConsole # A facade that handles template rendering and composition. # # It introduces template helpers to ease the inclusion of scripts only on # Rails error pages. class Template # Lets you customize the default templates folder location. cattr_accessor :template_paths, default: [ File.expand_path("../templates", __FILE__) ] def initialize(env, session) @env = env @session = session @mount_point = Middleware.mount_point end # Render a template (inferred from +template_paths+) as a plain string. def render(template) view = View.new(ActionView::LookupContext.new(template_paths), instance_values) view.render(template: template, layout: false) end end end
Version data entries
7 entries across 7 versions & 2 rubygems