Ruby on rails 4 如何显示图像字段';s在表演形式中的价值
我为一个实体创建、更新和显示表单。其中一个字段是我使用表单中的multipart属性输入的图像文件。我的问题是如何在show表单中显示image属性Ruby on rails 4 如何显示图像字段';s在表演形式中的价值,ruby-on-rails-4,Ruby On Rails 4,我为一个实体创建、更新和显示表单。其中一个字段是我使用表单中的multipart属性输入的图像文件。我的问题是如何在show表单中显示image属性 <tr> <th>Photo</th> <td><%= @teacher.photo %></td> </tr> 我们可以使用载波gem将图像显示为缩略图 <%= image_tag @teacher.photo_url(:thumb) if @teac
<tr>
<th>Photo</th>
<td><%= @teacher.photo %></td>
</tr>
我们可以使用载波gem将图像显示为缩略图
<%= image_tag @teacher.photo_url(:thumb) if @teacher.photo? %>
?
<%= image_tag @teacher.photo_url(:thumb) if @teacher.photo? %>