Class: RenderAnywhere::RenderingController

Inherits:
AbstractController::Base
  • Object
show all
Includes:
AbstractController::AssetPaths, AbstractController::Helpers, AbstractController::Layouts, AbstractController::Logger, AbstractController::Rendering, AbstractController::Translation
Defined in:
lib/render_anywhere/rendering_controller.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ RenderingController

configure the different paths correctly



22
23
24
25
26
27
28
# File 'lib/render_anywhere/rendering_controller.rb', line 22

def initialize(*args)
  super()
  lookup_context.view_paths = Rails.root.join('app', 'views')
  config.javascripts_dir = Rails.root.join('public', 'javascripts')
  config.stylesheets_dir = Rails.root.join('public', 'stylesheets')
  config.assets_dir = Rails.root.join('public')
end

Instance Method Details

#flashObject

so that your flash calls still work



36
37
38
# File 'lib/render_anywhere/rendering_controller.rb', line 36

def flash
  {}
end

#protect_against_forgery?Boolean

we are not in a browser, no need for this

Returns:

  • (Boolean)


31
32
33
# File 'lib/render_anywhere/rendering_controller.rb', line 31

def protect_against_forgery?
  false
end

#requestObject

and nil request to differentiate between live and offline



44
45
46
# File 'lib/render_anywhere/rendering_controller.rb', line 44

def request
  nil
end