Don P
Don P

Reputation: 63647

How can I print out an image tag to a Rails asset in javascript?

How can I print out an image tag to a Rails asset in javascript?

If I have an image at /assets/images/my_image.png, the following will show an image in development, but not in a production.

$('.myImage').html('<img src="/assets/images/my_image.png">');

Upvotes: 0

Views: 252

Answers (1)

Nithin
Nithin

Reputation: 3699

For heroku

  config.serve_static_assets = true

also use

gem 'rails_12factor', group: :production

heroku docs has good explanation you need to check out once.

Upvotes: 1

Related Questions