【发布时间】:2021-12-14 12:49:56
【问题描述】:
我需要在我的seeds.rb 中添加一个图像路径。我所有的图片都在资产/图片/课程中 我不明白如何在种子.rb 中正确地将图像路径添加到我的课程中
Course.create!(
name: "Art",
description: "In this beginner's art class learners will meet to create nature inspired artwork!
Perfect class for Pre-Kindergarten, Kindergarten, 1st grade & 2nd grade artists
(UK: Reception, Year 1, Year 2, Year 3)- with science & a touch of geography.",
tags: "#art #image #kids",
ages: "4 - 13",
minsize: 4,
maxsize: 7,
duration: 45,
price: 10,
image_url: "images/courses/art1.jpg",
)
【问题讨论】:
-
我认为问题不在于
seeds.rb文件,而在于您访问该 URL 的视图。
标签: ruby-on-rails ruby database