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

Assets for dashboard are not compatible with Asset Pipeline #496

Open
iwz opened this issue Aug 24, 2017 · 2 comments
Open

Assets for dashboard are not compatible with Asset Pipeline #496

iwz opened this issue Aug 24, 2017 · 2 comments

Comments

@iwz
Copy link

iwz commented Aug 24, 2017

When deploying to a production environment, the /split assets are not made available on the expected path. For example, /split/reset.css is a 404.

This seems to be because the engine does not use the recommended way of referring to assets for engines. Specifically, this section:

You can define assets for precompilation in engine.rb:

initializer "blorgh.assets.precompile" do |app|
  app.config.assets.precompile += %w( admin.js admin.css )
end

Instead of using the asset pipeline helpers like stylesheet_link_tag and javasript_include_tag in the Application Layout, the code is using a url method from the helpers. This is less compatible with some deploy environments than the asset pipeline.

A workaround is to extract the js and css assets from the gem and copy them into your host application under public/split. By doing so, the deployed split dashboard code will be able to find http://domain.com/split/reset.css, for example. I've implemented this workaround in my codebase and it does the trick.

I may open a PR in the near future to fix this up, but in the meantime I wanted to share this information with the community in case others struggle with this.

@andrew
Copy link
Member

andrew commented Aug 24, 2017

@iwz thanks for looking into this, a pull request to improve this would be 👌 when you have time.

@ayb
Copy link

ayb commented Oct 24, 2017

+1

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

No branches or pull requests

3 participants