Lesha Pipiev
Lesha Pipiev

Reputation: 3333

Rails 3.2 + mailer + image_tag

I have:

/public/images/fb.png

In /config/environment/development.rb:

config.action_mailer.asset_host = "http://192.155.90.155:3000"

In my mailer view:

image_tag 'fb.png'

Body of the mail contains:

<img src="http://192.155.90.155:3000/assets/fb.png">

But I would like to get:

<img src="http://192.155.90.155:3000/images/fb.png">

Upvotes: 2

Views: 1268

Answers (1)

R Milushev
R Milushev

Reputation: 4315

The asset-pipeline is made to simplify assets management . If you are about to use this nice feature , you should consider to stick to the conventions of the asset-pipeline . Here you can find the suggested assets organization , which recommends to place images into assets/images directories (which you can modify in your application.rb file ) and normally are app/assets/images , lib/assets/immages and vendor/assets/immages . Summary : place your image in one of the asset-pipeline managed directories.

Upvotes: 1

Related Questions