teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

誤字

2020/05/19 13:52

投稿

atata
atata

スコア38

title CHANGED
File without changes
body CHANGED
@@ -9,28 +9,106 @@
9
9
  (See full trace by running task with --trace)
10
10
 
11
11
 
12
- 対象データのde:seed 情報です。
12
+ ### **### 対象データのde:seed 情報です。
13
+ ### **親**
14
+ customer = Customer.create!(
15
+ email: 'test@co.jp',
16
+ password: '123456',
17
+ name: '佐藤'
18
+ )
19
+ ### 子
20
+ city_introduction_1 = CityIntroduction .create!(
21
+ name: '田中'
22
+ user_id: 2,    「63行目」 エラー箇所
23
+ address: 'aaa@co.jp',
24
+ introduction: '横浜',
25
+ comment: 'コメントコメント',
26
+ created_at: 1,
27
+ updated_at: 1,
28
+ image: File.open('./app/assets/images/big-star.png'),
29
+ customer_id: customer.id,
30
+ )
13
31
 
32
+ ### 以下情報
33
+ Staion.create!(
34
+ type_id: 1,
35
+ name: '横浜',
36
+ explanation: '都市景観100選受賞地区にも選ばれた横浜みなとみらいには横浜みなと博物館、パシフィコ横浜、横浜ランドマークタワー、よこはまコスモワールド、赤レンガ倉庫などの観光スポットが点在している。',
37
+ image: File.open('./app/assets/images/station/yokoham.jpg'),
14
- **city_introduction_1 = CityIntroduction .create!(
38
+ city_introduction_id: city_introduction_1 .id
39
+ )
15
40
 
41
+ Staion.create!(
42
+ type_id: 2,
16
- name: '田中'
43
+ name: '品川',
44
+ explanation: '品川は品川駅に新幹線が通っている事もあり、ターミナル駅として日々多くの人で賑わうエリア。高層ビルが立ち並ぶ近代的な街並みの中には、実は人気スポットもたくさんある。',
45
+ image: File.open('./app/assets/images/station/shinagawa.jpg'),
46
+ city_introduction_id: city_introduction_1 .id
47
+ )
17
48
 
49
+ Staion.create!(
18
- user_id: 1,
50
+ type_id: 3,
51
+ name: '新橋',
52
+ explanation: '駅前の広場全体を「SL広場」というが、待ち合わせスポットがある。また、東の汐留口側には電通や日本テレビ、パナソニックなどの本社が居を構えるオフィス街になっている。',
53
+ image: File.open('./app/assets/images/station/shinbashi.jpg'),
54
+ city_introduction_id: city_introduction_1 .id
55
+ )
19
56
 
57
+ Staion.create!(
58
+ type_id: 4,
20
- address: 'aaa@co.jp',
59
+ name: '新宿',
60
+ explanation: '新宿駅の乗降客数は全路線合計で約342万人(2015年)と言われており、この数字は世界一の数字でギネス記録にも認定されている。東口が有名で、アルタや伊勢丹などがある新宿通りと、歌舞伎町がある靖国通りがメイン通りといえる。',
61
+ image: File.open('./app/assets/images/station/shinzyuku.jpg'),
62
+ city_introduction_id: city_introduction_1 .id
63
+ )
21
64
 
65
+ Staion.create!(
66
+ type_id: 5,
22
- introduction: '横浜',
67
+ name: '渋谷',
68
+ explanation: '1日の通行人数は約50万人とも言われ、世界でも類を見ない通行量を誇るスクランブル交差点。JR東日本、京王電鉄、東急電鉄、東京メトロという4社の路線が乗り入れるターミナル駅になる。',
69
+ image: File.open('./app/assets/images/station/shibuya.jpg'),
70
+ city_introduction_id: city_introduction_1 .id
71
+ )
23
72
 
73
+ Staion.create!(
74
+ type_id: 6,
24
- comment: 'コメントコメント',
75
+ name: '東京',
76
+ explanation: '日本経済の中心的な役割を担う企業が多く集積する丸の内、八重洲。創建当時の姿に復原された、「東京駅赤煉瓦駅舎」をはじめ、丸の内ブリックスクエア、KITTEといった新名所が街に新たな魅力を加えている。',
77
+ image: File.open('./app/assets/images/station/toukyou.jpg'),
78
+ city_introduction_id: city_introduction_1 .id
79
+ )
25
80
 
81
+ Staion.create!(
26
- created_at: 1,
82
+ type_id: 7,
83
+ name: '上野',
84
+ explanation: '上野の特徴は、山手と下町の両方が共存している点。山手エリアは台地の上にある上野公園が中心で、国立西洋美術館をはじめ上野動物園など数多くの文化施設が集中。北側には、東京芸術大学のなど、閑静な住宅地が広がる。',
85
+ image: File.open('./app/assets/images/ueno.jpg'),
86
+ city_introduction_id: city_introduction_1 .id
87
+ )
27
88
 
89
+ Staion.create!(
28
- updated_at: 1,
90
+ type_id: 8,
91
+ name: '池袋',
92
+ explanation: '駅西口の『サンシャインシティ』は娯楽・観光のメッカとなっているほか、大ヒットドラマの舞台となった『池袋西口公園』も現在は池袋を象徴するスポットとして有名。横浜や大宮方面にも乗換せずに行けるため、交通アクセスは抜群に良い。',
93
+ image: File.open('./app/assets/images/station/ikebukuro.jpg'),
94
+ city_introduction_id: city_introduction_1 .id
95
+ )
29
96
 
97
+ Staion.create!(
98
+ type_id: 9,
99
+ name: '秋葉原',
100
+ explanation: '葉原の特徴としてあげられるのは、オタクの聖地です。家電店とコミックやフィギュアやメイド喫茶など、家電とオタクの雰囲気が交わった街です。日曜は歩行者天国になるため、一層賑わいを見せます。アニメや家電に興味がなくても、行くと独特の雰囲気があり楽しめます。',
30
- image: File.open('./app/assets/images/big-star.png'),
101
+ image: File.open('./app/assets/images/station/akihabara.jpg'),
102
+ city_introduction_id: city_introduction_1 .id
103
+ )
31
104
 
105
+ Staion.create!(
106
+ type_id: 10,
107
+ name: '恵比寿',
108
+ explanation: 'JR山手線、埼京線、湘南新宿ラインと東京メトロ日比谷線が利用可能で交通の弁は良く、恵比寿のランドマークといわれる『恵比寿ガーデンプレイス』や駅ビルの『アトレ恵比寿』、アトレ恵比寿西館の新設や中高層マンションの建築など、時代のトレンドを先取りする街並みがあります。',
109
+ image: File.open('./app/assets/images/station/ebisu.jpg'),
32
- customer_id: customer.id,
110
+ city_introduction_id: city_introduction_1 .id
111
+ )
33
112
 
34
- )**
35
113
 
36
- よろしくお願いします。
114
+ よろしくお願いします。**

1

誤字

2020/05/19 13:51

投稿

atata
atata

スコア38

title CHANGED
@@ -1,1 +1,1 @@
1
- db:seedでデータがエラーが出て上手く入れられません。
1
+ db:seedでデータがエラーが出て上手く入れられません。分かる方が入れば教えてください。
body CHANGED
File without changes