如何在同一列中播种多个项目?

时间:2019-05-22 17:54:22

标签: ruby-on-rails ruby ruby-on-rails-3

我正在尝试将多个项目播种到同一列中,即1个用户使用5种产品,但似乎无法正常工作,我想知道该怎么做?下面的代码


User.create!([{
  name: "Ant-Man",
  email: "1234@gmail.com",
  product: "mac","piano","paper","book",
  password: "123456",
},
{
  name: "Joe",
  email: "joe@gmail.com",
  product: "macboook",
  password: "123456",
},
{
  name: "Alice",
  email: "123@gmail.com",
  product: "mascara",
  password: "123456",
},
{
  name: "Amy",
  email: "amy@gmail.com",
  product: "travelling book",
  password: "123456",
},
{
  name: "James",
  email: "James@gmail.com",
  product: "pen",
  password: "123456",
},
{
  name: "Edward",
  email: "edward@gmail.com",
  product: "piano",
  password: "123456",
},])

0 个答案:

没有答案