Sha256: e9cde8edaa3a9bc3d874621d27c82acabdcfad936fc6d93529d4ff78278c6060
Contents?: true
Size: 700 Bytes
Versions: 4
Compression:
Stored size: 700 Bytes
Contents
module Enki module HostHelper # A simplistic way of skipping the host app view paths and rendering a file directly from a Rails::Engine. # An engine can technically have multiple app/views paths. This method uses only the first defined one. # # TODO: Add support for rendering methods other than :file. def render_enki(options) if options[:file] render options.merge(:file => File.join(Enki::Engine.paths['app/views'].first.to_s, options[:file])) elsif options[:page] render_enki(:file => 'enki/pages/show', :locals => { :page => options[:page] }) else raise ArgumentError, 'Unsupported render method.' end end end end
Version data entries
4 entries across 4 versions & 1 rubygems