Module: Enki::HostHelper
- Included in:
- ApplicationController
- Defined in:
- app/helpers/enki/host_helper.rb
Instance Method Summary collapse
-
#render_enki(options) ⇒ Object
A simplistic way of skipping the host app view paths and rendering a file directly from a Rails::Engine.
Instance Method Details
#render_enki(options) ⇒ Object
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.
8 9 10 11 12 13 14 15 16 |
# File 'app/helpers/enki/host_helper.rb', line 8 def render_enki() if [:file] render .merge(:file => File.join(Enki::Engine.paths['app/views'].first.to_s, [:file])) elsif [:page] render_enki(:file => 'enki/pages/show', :locals => { :page => [:page] }) else raise ArgumentError, 'Unsupported render method.' end end |