Developing rails engines and using the asset pipeline
-
30-10-2019 - |
Question
So I've started building a gem, which is difficult, but it seems to be working out so far..
Except for one little thing, the assets. I've tried putting them in my lib/assets
, app/assets
and vendor/assets
. But they don't seem to load.
I have a test-app which loads my gem to test it, but nothing seems to work. I have an engine in my gem which I'm sure is being loaded.
What more do I need to know for this to start working?
EDIT:
here is my engine (located in lib/baco/engine.rb
):
require 'rails'
module Baco
class Engine < Rails::Engine
end
end
EDIT 2:
This is my css file (located in vendor/assets/stylesheets/application.css.scss
):
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require baco
*/
input {
padding:10px;
}
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow