I have several applications for resource pipelines using shared resources. I need these resources to be configured according to which application required them, for example, to have a built-in asset or not.
For instance:
application.rb
config.assets.precompile += %w( app1.js app1.css )
config.assets.precompile += %w( app2.js app2.css )
app1.js
*= require blabla1
*= require common
app2.js
*= require blabla2
*= require common
I want to have different results in accordance with the current entry point into the pipeline, for example, something in the spirit of the following:
common.js.erb
var src="<%= currentAssetPiplineEntryPoint == 'app1' ? image_path('img.png') : asset_data_uri('img.png')%>"
doable?
If not, is it due to bad practice?
thank
source
share