嗨,我是Ror上的新人,在我的新应用程序上,我使用cloudinary和attachinary gem在我的产品页面上显示我的照片。我没有成功地在我的展示页面上只显示与我的产品对应的第一张照片,而不是所有的产品照片。有没有云计算助手告诉我希望在这个地方显示product.picture 1或product.picture 2?感谢你的帮助,
下面是我的代码: lesson.html.erb
<% @lesson.photos.each do |photo| %>
<%= cl_image_tag photo.path, width: 400, height: 200, crop: :fill %>
<% end %>_form.html.erb:
<%= simple_form_for(@lesson) do |f| %>
<%= f.input :name %>
Photo 1 <%= f.input :photo %>
<%= f.input :photo_cache, as: :hidden %><br>
Photo 2 <%= f.input :photo %>
<%= f.input :photo_cache, as: :hidden %><br>
<%= f.button :submit %>
<% end %>https://stackoverflow.com/questions/51264248
复制相似问题