Ruby on Rails
Wednesday, July 26, 2017
Hi, how do I push fake data with faker when I have:
-- blog
title:string
and
comment
name:string
body:text_field
comments belongs_to :blog
then seed.rb:
5.times do
comment.create([{
name: Faker::jadajada
body: Faker::jadajada
}])
but how do I include blog title as well? There should be some kind of nesting?
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fbfd0b3d-fabb-433d-a505-1dd8bf76868a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment