I have created grails application and uploaded it in heroku.
If I use \'heroku scale web=1\' everything looks OK. But if I run \'heroku scale web=2\', some
I had similar issues with image files that cannot be directly defined in ApplicationResources.groovy. I found a workaround for this one, though:
Add a CSS file to ApplicationResources.groovy that has multiple class definitions for all the assets you need to load like this:
.asset1 {
background: url('path/to/image1.png');
}
.asset2 {
background: url('path/to/image2.png');
}
.asset3 {
background: url('path/to/image3.png');
}
...
And in ApplicationResources.groovy define the following:
modules = {
...
myModule {
resource url: 'path/to/assets.css'
}
...
}
Now the Resources plugin has already those paths ready for the images when the module that contains the CSS file is loaded from a GSP view, or if the images are referenced dynamically from JavaScript etc.
Rather hacky but it works. Tested this in Heroku with 2 dynos.