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

Initializer crashes if asset pipeline is not used #11

Closed
Intrepidd opened this issue Dec 22, 2020 · 2 comments · Fixed by #17
Closed

Initializer crashes if asset pipeline is not used #11

Intrepidd opened this issue Dec 22, 2020 · 2 comments · Fixed by #17

Comments

@Intrepidd
Copy link
Contributor

Intrepidd commented Dec 22, 2020

If the application does not use the asset pipeline, the app will crash because of the following initializer :

    initializer "turbo.assets" do
      Rails.application.config.assets.precompile += %w( turbo )
    end

undefined method `assets' for #Rails::Application::Configuration:0x00007fa70a4d6be8 (NoMethodError)

Happy to provide a pull request to fix this behaviour if you believe it should not crash in this case

Thanks for making this ! <3

@jasl
Copy link

jasl commented Dec 23, 2020

a small fix would work

if Rails.application.config.respond_to? :assets
  Rails.application.config.assets.precompile += %w( turbo )
end

any volunteer?

@Intrepidd
Copy link
Contributor Author

I'll check how it's done in other rails engines and submit a PR

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

Successfully merging a pull request may close this issue.

2 participants