Situation
- I use
bower. - In .bowerrc registered directory
"vendor/assets/bower_components". - In the application.rb register,
config.assets.paths << Rails.root.join('vendor', 'assets', 'bower_components')wrote theconfig.assets.paths << Rails.root.join('vendor', 'assets', 'bower_components'). - I installed the
fotoramaplugin. - All files of photo frames now lie here
"/vendor/assets/bower_components/fotorama". - Then I added the line
*= require fotorama/fotorama.cssto application.css (I added what I need in application.js, but this is not important here). - In the layout file, I wrote
<%= stylesheet_link_tag "application", media: "all" %>.
I run the rails server - everything works just perfect. The file with css was inserted in this way <link href="/assets/fotorama/fotorama.css?body=1" media="all" rel="stylesheet" /> , inside this file there is a line: .fotorama__video-play {background: url(fotorama.png) no-repeat} , and indeed, the fotorama.png file is next to the css file specified in the <link> . I chop off the server, recompile all assets rake assets:precompile and start the server in production mode rails server -e production .
Problem
In production mode, all css is merged into one large file, it looks like this: <link href="/assets/application-2d31fc33890d01b046194920367eb3d4.css" media="all" rel="stylesheet" /> , it still has a line .fotorama__video-play {background: url(fotorama.png) no-repeat} , well, in general, because of it the browser is trying to find a file with a picture here: http://localhost:3000/assets/fotorama.png , and there is no, honestly, it is nowhere else at all.
Questions:
- Why didn't the pictures from the
/vendor/assets/bower_componentsfolder fly to thepublic/assetsfolder? - In order to come up with this, it will work, provided: do not change the contents of the fotorama.css file with my hands (programmatically, I agree), because I’m not comfortable with my hands into vendor packages?
I have not been able to cope with this problem for a long time, I will be grateful for any attempts to help me. Thank.