質問編集履歴
1
コードの書き直し
test
CHANGED
File without changes
|
test
CHANGED
@@ -198,101 +198,7 @@
|
|
198
198
|
|
199
199
|
self.data = [
|
200
200
|
|
201
|
-
|
201
|
+
|
202
|
-
|
203
|
-
{ id: 2, name: '北海道' },
|
204
|
-
|
205
|
-
{ id: 3, name: '青森県' },
|
206
|
-
|
207
|
-
{ id: 4, name: '岩手県' },
|
208
|
-
|
209
|
-
{ id: 5, name: '宮城県' },
|
210
|
-
|
211
|
-
{ id: 6, name: '秋田県' },
|
212
|
-
|
213
|
-
{ id: 7, name: '山形県' },
|
214
|
-
|
215
|
-
{ id: 8, name: '福島県' },
|
216
|
-
|
217
|
-
{ id: 9, name: '茨城県' },
|
218
|
-
|
219
|
-
{ id: 10, name: '栃木県' },
|
220
|
-
|
221
|
-
{ id: 11, name: '群馬県' },
|
222
|
-
|
223
|
-
{ id: 12, name: '埼玉県' },
|
224
|
-
|
225
|
-
{ id: 13, name: '千葉県' },
|
226
|
-
|
227
|
-
{ id: 14, name: '東京都' },
|
228
|
-
|
229
|
-
{ id: 15, name: '神奈川県' },
|
230
|
-
|
231
|
-
{ id: 16, name: '新潟県' },
|
232
|
-
|
233
|
-
{ id: 17, name: '富山県' },
|
234
|
-
|
235
|
-
{ id: 18, name: '石川県' },
|
236
|
-
|
237
|
-
{ id: 19, name: '福井県' },
|
238
|
-
|
239
|
-
{ id: 20, name: '山梨県' },
|
240
|
-
|
241
|
-
{ id: 21, name: '長野県' },
|
242
|
-
|
243
|
-
{ id: 22, name: '岐阜県' },
|
244
|
-
|
245
|
-
{ id: 23, name: '静岡県' },
|
246
|
-
|
247
|
-
{ id: 24, name: '愛知県' },
|
248
|
-
|
249
|
-
{ id: 25, name: '三重県' },
|
250
|
-
|
251
|
-
{ id: 26, name: '滋賀県' },
|
252
|
-
|
253
|
-
{ id: 27, name: '京都府' },
|
254
|
-
|
255
|
-
{ id: 28, name: '大阪府' },
|
256
|
-
|
257
|
-
{ id: 29, name: '兵庫県' },
|
258
|
-
|
259
|
-
{ id: 30, name: '奈良県' },
|
260
|
-
|
261
|
-
{ id: 31, name: '和歌山県' },
|
262
|
-
|
263
|
-
{ id: 32, name: '鳥取県' },
|
264
|
-
|
265
|
-
{ id: 33, name: '島根県' },
|
266
|
-
|
267
|
-
{ id: 34, name: '岡山県' },
|
268
|
-
|
269
|
-
{ id: 35, name: '広島県' },
|
270
|
-
|
271
|
-
{ id: 36, name: '山口県' },
|
272
|
-
|
273
|
-
{ id: 37, name: '徳島県' },
|
274
|
-
|
275
|
-
{ id: 38, name: '香川県' },
|
276
|
-
|
277
|
-
{ id: 39, name: '愛媛県' },
|
278
|
-
|
279
|
-
{ id: 40, name: '高知県' },
|
280
|
-
|
281
|
-
{ id: 41, name: '福岡県' },
|
282
|
-
|
283
|
-
{ id: 42, name: '佐賀県' },
|
284
|
-
|
285
|
-
{ id: 43, name: '長崎県' },
|
286
|
-
|
287
|
-
{ id: 44, name: '熊本県' },
|
288
|
-
|
289
|
-
{ id: 45, name: '大分県' },
|
290
|
-
|
291
|
-
{ id: 46, name: '宮崎県' },
|
292
|
-
|
293
|
-
{ id: 47, name: '鹿児島県' },
|
294
|
-
|
295
|
-
{ id: 48, name: '沖縄県' }
|
296
202
|
|
297
203
|
]
|
298
204
|
|
@@ -314,55 +220,7 @@
|
|
314
220
|
|
315
221
|
self.data = [
|
316
222
|
|
317
|
-
|
223
|
+
|
318
|
-
|
319
|
-
{ id: 2, name: '千代田区' },
|
320
|
-
|
321
|
-
{ id: 3, name: '中央区' },
|
322
|
-
|
323
|
-
{ id: 4, name: '港区' },
|
324
|
-
|
325
|
-
{ id: 5, name: '渋谷区' },
|
326
|
-
|
327
|
-
{ id: 6, name: '新宿区' },
|
328
|
-
|
329
|
-
{ id: 7, name: '文京区' },
|
330
|
-
|
331
|
-
{ id: 8, name: '台東区' },
|
332
|
-
|
333
|
-
{ id: 9, name: '墨田区' },
|
334
|
-
|
335
|
-
{ id: 10, name: '江東区' },
|
336
|
-
|
337
|
-
{ id: 11, name: '品川区' },
|
338
|
-
|
339
|
-
{ id: 12, name: '大田区' },
|
340
|
-
|
341
|
-
{ id: 13, name: '目黒区' },
|
342
|
-
|
343
|
-
{ id: 14, name: '世田谷区' },
|
344
|
-
|
345
|
-
{ id: 15, name: '豊島区' },
|
346
|
-
|
347
|
-
{ id: 16, name: '北区' },
|
348
|
-
|
349
|
-
{ id: 17, name: '板橋区' },
|
350
|
-
|
351
|
-
{ id: 18, name: '練馬区' },
|
352
|
-
|
353
|
-
{ id: 19, name: '足立区' },
|
354
|
-
|
355
|
-
{ id: 20, name: '荒川区' },
|
356
|
-
|
357
|
-
{ id: 21, name: '中野区' },
|
358
|
-
|
359
|
-
{ id: 22, name: '杉並区' },
|
360
|
-
|
361
|
-
{ id: 23, name: '葛飾区' },
|
362
|
-
|
363
|
-
{ id: 24, name: '江戸川区' }
|
364
|
-
|
365
|
-
]
|
366
224
|
|
367
225
|
|
368
226
|
|
@@ -410,4 +268,370 @@
|
|
410
268
|
|
411
269
|
|
412
270
|
|
271
|
+
```newHTML
|
272
|
+
|
273
|
+
<div class="homes-sell-contents">
|
274
|
+
|
275
|
+
<header class="homes-sell-header">
|
276
|
+
|
277
|
+
<%= link_to image_tag('meiwa.png' , size: '185x50'), "/" %>
|
278
|
+
|
413
|
-
|
279
|
+
</header>
|
280
|
+
|
281
|
+
<div class="homes-sell-main">
|
282
|
+
|
283
|
+
<h2 class="homes-sell-title">物件の情報を入力</h2>
|
284
|
+
|
285
|
+
<%= form_with(model: @home, local: true) do |f| %>
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
<%# インスタンスを渡して、エラー発生時にメッセージが表示されるようにしましょう。%>
|
290
|
+
|
291
|
+
<%= render 'shared/error_messages', model: f.object %>
|
292
|
+
|
293
|
+
<%# //インスタンスを渡して、エラー発生時にメッセージが表示されるようにしましょう。%>
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
<%# 出品画像 %>
|
298
|
+
|
299
|
+
<div class="img-upload">
|
300
|
+
|
301
|
+
<div class="weight-bold-text">
|
302
|
+
|
303
|
+
物件画像
|
304
|
+
|
305
|
+
<span class="indispensable">必須</span>
|
306
|
+
|
307
|
+
</div>
|
308
|
+
|
309
|
+
<div class="click-upload">
|
310
|
+
|
311
|
+
<p>
|
312
|
+
|
313
|
+
クリックしてファイルをアップロード
|
314
|
+
|
315
|
+
</p>
|
316
|
+
|
317
|
+
<%= f.file_field :images, name: 'home[images][]', id:"home-image" %>
|
318
|
+
|
319
|
+
</div>
|
320
|
+
|
321
|
+
<div id= "home-box-img">
|
322
|
+
|
323
|
+
</div>
|
324
|
+
|
325
|
+
</div>
|
326
|
+
|
327
|
+
<%# /物件画像 %>
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
<%# 物件名と築年数、最寄り徒歩時間 %>
|
332
|
+
|
333
|
+
<div class="new-homes">
|
334
|
+
|
335
|
+
<div class="weight-bold-text">
|
336
|
+
|
337
|
+
物件名
|
338
|
+
|
339
|
+
<span class="indispensable">必須</span>
|
340
|
+
|
341
|
+
</div>
|
342
|
+
|
343
|
+
<%= f.text_area :home_name, class:"homes-text", id:"home-name", placeholder:"商品名(必須 40文字まで)", maxlength:"40" %>
|
344
|
+
|
345
|
+
<div class="homes-explain">
|
346
|
+
|
347
|
+
<div class="weight-bold-text">
|
348
|
+
|
349
|
+
築年数 最寄り駅(徒歩〜分)
|
350
|
+
|
351
|
+
<span class="indispensable">必須</span>
|
352
|
+
|
353
|
+
</div>
|
354
|
+
|
355
|
+
<%= f.text_area :age, class:"homes-text", id:"item-info", placeholder:"築年数 〜年 最寄り駅(徒歩〜分)" ,rows:"7" ,maxlength:"1000" %>
|
356
|
+
|
357
|
+
</div>
|
358
|
+
|
359
|
+
</div>
|
360
|
+
|
361
|
+
<%# /物件名と築年数、最寄り徒歩時間 %>
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
<%# 担当者連絡先 %>
|
366
|
+
|
367
|
+
<div class="homes-detail">
|
368
|
+
|
369
|
+
<div class = "name">
|
370
|
+
|
371
|
+
<div class="weight-bold-text">
|
372
|
+
|
373
|
+
担当者
|
374
|
+
|
375
|
+
<span class="indispensable">必須</span>
|
376
|
+
|
377
|
+
</div>
|
378
|
+
|
379
|
+
<div class="form">
|
380
|
+
|
381
|
+
氏名
|
382
|
+
|
383
|
+
</div>
|
384
|
+
|
385
|
+
<%= f.text_area :name, class:"input-default", id:"name", placeholder:"例) furima太郎" %>
|
386
|
+
|
387
|
+
</div>
|
388
|
+
|
389
|
+
<div class="tel">
|
390
|
+
|
391
|
+
<div class="weight-bold-text">
|
392
|
+
|
393
|
+
電話番号
|
394
|
+
|
395
|
+
<span class="indispensable">必須</span>
|
396
|
+
|
397
|
+
</div>
|
398
|
+
|
399
|
+
<%= f.text_field :tel, class:"input-default", id:"phone-number", placeholder:"例)09012345678",maxlength:"11"%>
|
400
|
+
|
401
|
+
</div>
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
<div class="email">
|
406
|
+
|
407
|
+
<div class="weight-bold-text">
|
408
|
+
|
409
|
+
メールアドレス
|
410
|
+
|
411
|
+
<span class="indispensable">必須</span>
|
412
|
+
|
413
|
+
</div>
|
414
|
+
|
415
|
+
<%= f.email_field :email, class:"input-default", id:"email", placeholder:"PC・携帯どちらでも可", autofocus: true %>
|
416
|
+
|
417
|
+
</div>
|
418
|
+
|
419
|
+
</div>
|
420
|
+
|
421
|
+
<%# /担当者連絡先 %>
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
<%# 所在地 %>
|
426
|
+
|
427
|
+
<div class="home-address">
|
428
|
+
|
429
|
+
<div class="weight-bold-text">
|
430
|
+
|
431
|
+
物件住所
|
432
|
+
|
433
|
+
<span class="indispensable">必須</span>
|
434
|
+
|
435
|
+
</div>
|
436
|
+
|
437
|
+
<div class="prefecture">
|
438
|
+
|
439
|
+
<div class="weight-bold-text">
|
440
|
+
|
441
|
+
物件の地域 <%#都道府県%>
|
442
|
+
|
443
|
+
<span class="indispensable">必須</span>
|
444
|
+
|
445
|
+
</div>
|
446
|
+
|
447
|
+
<%= f.collection_select(:prefecture_id, Prefecture.all, :id, :name, {}, {class:"select-box", id:"home-prefecture"}) %>
|
448
|
+
|
449
|
+
</div>
|
450
|
+
|
451
|
+
<div class="class">
|
452
|
+
|
453
|
+
<div class="weight-bold-text">
|
454
|
+
|
455
|
+
物件区域 <%#東京23区%>
|
456
|
+
|
457
|
+
<span class="indispensable">必須</span>
|
458
|
+
|
459
|
+
</div>
|
460
|
+
|
461
|
+
<%= f.collection_select(:class_id, Class.all, :id, :name, {}, {class:"select-box", id:"home-class"}) %>
|
462
|
+
|
463
|
+
</div>
|
464
|
+
|
465
|
+
<div class= "city">
|
466
|
+
|
467
|
+
<div class="weight-bold-text">
|
468
|
+
|
469
|
+
市町村
|
470
|
+
|
471
|
+
<span class="indispensable">任意</span>
|
472
|
+
|
473
|
+
</div>
|
474
|
+
|
475
|
+
<%= f.text_field :city, class:"input-default", id:"city", placeholder:"例)横浜市緑区"%>
|
476
|
+
|
477
|
+
</div>
|
478
|
+
|
479
|
+
<div class="address">
|
480
|
+
|
481
|
+
<div class="weight-bold-text">
|
482
|
+
|
483
|
+
番地
|
484
|
+
|
485
|
+
<span class="indispensable">必須</span>
|
486
|
+
|
487
|
+
</div>
|
488
|
+
|
489
|
+
<%= f.text_field :address, class:"input-default", id:"addresses", placeholder:"例)青山1-1-1"%>
|
490
|
+
|
491
|
+
</div>
|
492
|
+
|
493
|
+
</div>
|
494
|
+
|
495
|
+
<%# /所在地 %>
|
496
|
+
|
497
|
+
|
498
|
+
|
499
|
+
<%# 販売価格 %>
|
500
|
+
|
501
|
+
<div class="sell-price">
|
502
|
+
|
503
|
+
<div class="weight-bold-text">
|
504
|
+
|
505
|
+
販売価格
|
506
|
+
|
507
|
+
</div>
|
508
|
+
|
509
|
+
<div class="price-content">
|
510
|
+
|
511
|
+
<div class="weight-bold-text">
|
512
|
+
|
513
|
+
価格
|
514
|
+
|
515
|
+
<span class="indispensable">必須</span>
|
516
|
+
|
517
|
+
</div>
|
518
|
+
|
519
|
+
<%= f.text_field :price, class:"price-input", id:"item-price", placeholder:"半角数字で記入" %>
|
520
|
+
|
521
|
+
</div>
|
522
|
+
|
523
|
+
<div class="price-rate">
|
524
|
+
|
525
|
+
<div class="weight-bold-text">
|
526
|
+
|
527
|
+
販売時金利 (%)
|
528
|
+
|
529
|
+
<span class="indispensable">必須</span>
|
530
|
+
|
531
|
+
</div>
|
532
|
+
|
533
|
+
<span>
|
534
|
+
|
535
|
+
<%= f.text_field :rate, class:"rate-input", id:"item-price", placeholder:"半角数字で記入" %>
|
536
|
+
|
537
|
+
</span>
|
538
|
+
|
539
|
+
</div>
|
540
|
+
|
541
|
+
<div class="price-rent">
|
542
|
+
|
543
|
+
<div class="weight-bold-text">
|
544
|
+
|
545
|
+
家賃
|
546
|
+
|
547
|
+
<span class="indispensable">必須</span>
|
548
|
+
|
549
|
+
</div>
|
550
|
+
|
551
|
+
<span class="sell-yen"></span>円
|
552
|
+
|
553
|
+
<%= f.text_field :rent, class:"rent-input", id:"item-price", placeholder:"半角数字で記入" %>
|
554
|
+
|
555
|
+
</div>
|
556
|
+
|
557
|
+
<div class="price-management">
|
558
|
+
|
559
|
+
<div class="management-price-text">
|
560
|
+
|
561
|
+
管理費
|
562
|
+
|
563
|
+
<span class="indispensable">必須</span>
|
564
|
+
|
565
|
+
</div>
|
566
|
+
|
567
|
+
<span class="sell-yen"></span>円
|
568
|
+
|
569
|
+
<%= f.text_field :management, class:"price-input", id:"item-price", placeholder:"半角数字で記入" %>
|
570
|
+
|
571
|
+
</div>
|
572
|
+
|
573
|
+
</div>
|
574
|
+
|
575
|
+
</div>
|
576
|
+
|
577
|
+
<%# /販売価格 %>
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
<%#入居者有無%>
|
582
|
+
|
583
|
+
<div class = "home-resident">
|
584
|
+
|
585
|
+
<div class ="resident">
|
586
|
+
|
587
|
+
<div class="weight-bold-text">
|
588
|
+
|
589
|
+
入居者
|
590
|
+
|
591
|
+
</div>
|
592
|
+
|
593
|
+
<span class="indispensable">必須</span>
|
594
|
+
|
595
|
+
<div class="field">
|
596
|
+
|
597
|
+
<% %w( 入居あり 入居なし).each.with_index do |ingredient,i| %>
|
598
|
+
|
599
|
+
<label>
|
600
|
+
|
601
|
+
<%= check_box_tag 'home[ingredients][]', ingredient,false,id:"home_ingredients_#{i}"%>
|
602
|
+
|
603
|
+
<%= ingredient %>
|
604
|
+
|
605
|
+
</label>
|
606
|
+
|
607
|
+
<% end %>
|
608
|
+
|
609
|
+
</div>
|
610
|
+
|
611
|
+
</div>
|
612
|
+
|
613
|
+
</div>
|
614
|
+
|
615
|
+
<%#/入居者有無%>
|
616
|
+
|
617
|
+
|
618
|
+
|
619
|
+
<%# 下部ボタン %>
|
620
|
+
|
621
|
+
<div class="sell-btn-contents">
|
622
|
+
|
623
|
+
<%= f.submit "登録する" ,class:"sell-btn" %>
|
624
|
+
|
625
|
+
<%=link_to 'もどる', root_path, class:"back-btn" %>
|
626
|
+
|
627
|
+
</div>
|
628
|
+
|
629
|
+
# /下部ボタン %>
|
630
|
+
|
631
|
+
</div>
|
632
|
+
|
633
|
+
<% end %>
|
634
|
+
|
635
|
+
</div> <%
|
636
|
+
|
637
|
+
```
|