Scott Simpson
Scott Simpson

Reputation: 3850

image_tag different on production versus development

I am using image_tag in Rails. Locally it resolves to /assets/image.img. On Heroku it resolves to /images/image.img.

I have the asset pipeline turned off (this project will eventually leave Rails).

How can I make local resolve the same as production?

Upvotes: 3

Views: 3669

Answers (2)

Scott Simpson
Scott Simpson

Reputation: 3850

# config/environments/production.rb
...
config.assets.compile = true
...

This fixed my problem. I guess this has something to do with the pipeline being turned off. Any comments on this are appreciated to help my understanding.

Upvotes: 4

Siwei
Siwei

Reputation: 21559

what's your complete image_tag ?
does it use

image_tag(asset_path('image.img'))

, or

image_tag('image.img')

?

If you turned the asset pipeline off, I suggest you don't use the asset_path form.

Upvotes: 4

Related Questions