1

I'm using rails 3.2.5. I used 'cache => true' option to combine javascript files. I wrote following code.

<%= javascript_include_tag "a.js", "b.js", :cache => true %>

I get the following error when I try to load the page.

No such file or directory - Asset file not found at '/home/MyProjectPath/public/javascripts/home/MyProjectPath/app/assets/javascripts/a.js'

a.js and b.js are located in 'app/assets/javascripts/'.

If I use this code,

<%= javascript_include_tag "a.js", "b.js" %>

It works fine. But they remain separate javascript files.

How can I merge javascript files using :cache option?

2 Answers 2

2

I think what you're looking for is :compress, not :cache . The error message you get is because the ":cache" option was removed, see the note in: http://edgeguides.rubyonrails.org/asset_pipeline.html#in-production

Sign up to request clarification or add additional context in comments.

Comments

0

Make your asset enable false in in application.rb file

config.assets.enabled = false

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.