Skip to content

Commit

Permalink
fixes from local usage
Browse files Browse the repository at this point in the history
  • Loading branch information
evdevdev committed Sep 13, 2024
1 parent caf1493 commit d255830
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/action_prompt/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

module ActionPrompt
class Railtie < Rails::Railtie
config.autoload_paths << Rails.root.join("tests/prompts")

config.after_initialize do |app|
if Rails.env.development? || Rails.env.test?
app.routes.prepend do
Expand Down
2 changes: 1 addition & 1 deletion lib/action_prompt/renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize
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)
controller.render_to_string(template: template_name, locals: locals, layout: false)
end
end
end
5 changes: 5 additions & 0 deletions test/dummy/app/prompts/hello_multiline.text.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This is line one

This is line two

This is line three

0 comments on commit d255830

Please sign in to comment.