Raaz
Raaz

Reputation: 1771

serving static assets in production in aws ec2 instance

I have a rails app which depends on a mithril library that I have created. That mithril library is the heart of the app. From that library, vdom are rendered and models are rendered. The library is installed into my app via bower.

In my mithril lib, I have called images like this

m('img.u-marginbottom-10[alt=\'Icon blog\'][src=\'/assets/icon-blog.png\']')

In the dev env, this is working fine however when I push it to prod env these links just break.

I know that it is happening because rails assets pipeline adds digest to those image files. Is there any way I can reference it?

In Heroku, because of rails12_factor gem, the assets are delivered without a problem but I am migrating the app to aws server and I am getting this issue

Upvotes: 0

Views: 87

Answers (1)

Gaurav Soni
Gaurav Soni

Reputation: 111

In Rails 4, non-digest assets are not pre-compiled. Try using non-stupid-diget-assets gem. It will generate the non-digset version of assets as well.

Upvotes: 1

Related Questions