Class: ActionPrompt::Renderer
- Inherits:
-
Object
- Object
- ActionPrompt::Renderer
- Defined in:
- lib/action_prompt/renderer.rb
Instance Method Summary collapse
-
#initialize ⇒ Renderer
constructor
A new instance of Renderer.
- #render(template_name, locals: {}) ⇒ Object
Constructor Details
#initialize ⇒ Renderer
Returns a new instance of Renderer.
3 4 5 |
# File 'lib/action_prompt/renderer.rb', line 3 def initialize # NOOP end |
Instance Method Details
#render(template_name, locals: {}) ⇒ Object
7 8 9 10 11 |
# File 'lib/action_prompt/renderer.rb', line 7 def render(template_name, locals: {}) controller = ApplicationController.new controller.prepend_view_path(Rails.root.join("app", "prompts")) controller.render_to_string(template: template_name, locals: locals, layout: false) end |