html - Rails image doesn't show up in mailers
问题描述
I send 2 types of e-mails in my application: welcome mailer, reset password mailer. I need to have the same logo at the top of each of them. I thought it will be easy job to do but unfortunately the logo seems to be broken. Here is my for welcome mailer code:
views/devise/layouts/devise_mailer.html.erb
<body>
<div class="container">
<%= image_tag("logo.png", class: 'logo', align: :center) %>
<%= yield %>
</div>
</body>
Based on docs I've added asset_host to the config file https://edgeguides.rubyonrails.org/action_mailer_basics.html#adding-images-in-action-mailer-views
config/development.rb
config.action_mailer.asset_host = 'localhost:3000'
The logo itself is in app/assets/images/logo.png
.
解决方案
推荐阅读
- react-native - 我需要一些帮助来在屏幕之间导航
- python - python - 如何将带有年份的周数转换为python pandas中的日期时间格式?
- python - RESTful API 中的 POST 方法适用于 HTTPie,但不适用于 Android/Postman
- c# - 我如何从随机图片框中计算点数
- deployment - 无法部署虚拟助手模板:'术语 az 未被识别为 cmdlet 的名称
- java - 更喜欢私有静态方法而不是实例方法
- java - Bridj 不再适用于 Windows 任务栏加载
- excel - 根据单元格值更改行颜色 - 如果值相同,则应用相同的单元格值
- android - 暂停 Android ndk 应用程序时如何保留 EGL 上下文
- ruby-on-rails - Ruby short IF 更短?