Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues while trying app #1

Open
woodhull opened this issue Aug 3, 2023 · 1 comment
Open

Issues while trying app #1

woodhull opened this issue Aug 3, 2023 · 1 comment

Comments

@woodhull
Copy link

woodhull commented Aug 3, 2023

  • The syntax for the template configuration file is wrong.
AhoyCaptain.configure 

should be

AhoyCaptain.configure do |config|
  • Docs imply that I should run a generator to add additional indexes, but this task does not exist.

  • We do not use the turbo gem in our application. We do render some templates in background jobs. After installing the ahoy_captain gem those jobs get errors like this:

    NoMethodError:
       Could not render layout: undefined method `headers' for nil:NilClass
     # /usr/local/bundle/gems/turbo-rails-1.4.0/app/controllers/turbo/frames/frame_request.rb:34:in `turbo_frame_request_id'
     # /usr/local/bundle/gems/turbo-rails-1.4.0/app/controllers/turbo/frames/frame_request.rb:30:in `turbo_frame_request?'
     # /usr/local/bundle/gems/turbo-rails-1.4.0/app/controllers/turbo/frames/frame_request.rb:24:in `block (2 levels) in <module:FrameRequest>'
     # ./app/sidekiq/add_card_to_stage.rb:11:in `perform'

I'm not clear on why adding the ahoy_captain gem causes turbo gem code to be called outside of the engine itself.

@joshmn
Copy link
Owner

joshmn commented Aug 3, 2023

Ah that's a weird one! The turbo thing, at least — I do need to update the configuration file (this was made hastily in a recent railshackathon.com-thon).

I think this might be happening from one of your background jobs indeed. How are you rendering the templates? Are you using ApplicationController.render or perhaps render_to_string? Curious to see add_card_to_stage.rb and if you're invoking any callbacks before render.

There are a pair of callbacks that are invoked by AhoyCaptain that check if the request is a turbo request or one that it could handle: https://github.com/joshmn/ahoy_captain/blob/main/app/controllers/ahoy_captain/application_controller.rb#L31 (also L38)

If you can provide some insight to those I can probably track this down fairly quickly :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants