質問編集履歴

2

追記

2020/10/25 08:35

投稿

Leandro
Leandro

スコア3

test CHANGED
File without changes
test CHANGED
@@ -370,7 +370,7 @@
370
370
 
371
371
  ```
372
372
 
373
- `view/user/edit`
373
+ `views/users/edit.html`
374
374
 
375
375
 
376
376
 
@@ -420,4 +420,168 @@
420
420
 
421
421
  ```
422
422
 
423
+ ## レイアウト
424
+
425
+ `views/layout/application.html.erb`
426
+
427
+ ```ruby
428
+
429
+ <!DOCTYPE html>
430
+
431
+ <html>
432
+
433
+ <head>
434
+
435
+ <title>Bookers2</title>
436
+
437
+ <%= csrf_meta_tags %>
438
+
439
+ <%= csp_meta_tag %>
440
+
441
+
442
+
443
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
444
+
445
+ <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
446
+
447
+ </head>
448
+
449
+ <body class="container-fluid ">
450
+
451
+ <%= render partial: "shered/header" %>
452
+
453
+ <%= yield %>
454
+
455
+ </body>
456
+
457
+ </html>
458
+
459
+ ```
460
+
461
+ `views/shared/_header.html.erb`
462
+
463
+ ```ruby
464
+
465
+ <header class="row bg-dark justify-content-between p-2">
466
+
467
+ <div class="text-white">
468
+
469
+ <h2>Bookers</h2>
470
+
471
+ </div>
472
+
473
+ <ul class="nav">
474
+
475
+ <% if user_signed_in? %>
476
+
477
+ <li class="nav-item">
478
+
479
+ <!-- Home -->
480
+
481
+ <%= link_to user_path(current_user.id) ,class: "nav-link text-white" do%>
482
+
483
+ <%= fa_icon "home" %> Home
484
+
485
+ <%end%>
486
+
487
+ </li>
488
+
489
+ <li class="nav-item">
490
+
491
+ <!-- Users -->
492
+
493
+ <%= link_to users_path ,class: "nav-link text-white" do%>
494
+
495
+ <%= fa_icon "users" %> Users
496
+
497
+ <%end%>
498
+
499
+ </li>
500
+
501
+ <li class="nav-item">
502
+
503
+ <!-- Books -->
504
+
505
+ <%= link_to books_path ,class: "nav-link text-white" do%>
506
+
507
+ <%= fa_icon "book" %> Books
508
+
509
+ <%end%>
510
+
511
+ </li>
512
+
513
+ <li class="nav-item">
514
+
515
+ <!-- Log out -->
516
+
517
+ <%= link_to destroy_user_session_path, method: :delete ,class: "nav-link text-white" do%>
518
+
519
+ <%= fa_icon "sign-out" %> log out
520
+
521
+ <% end %>
522
+
523
+ </li>
524
+
525
+ </ul>
526
+
527
+ <% else%>
528
+
529
+ <li class="nav-item">
530
+
531
+ <!-- Home -->
532
+
533
+ <%= link_to new_user_session_path ,class: "nav-link text-white" do%>
534
+
535
+ <%= fa_icon "home" %> Home
536
+
537
+ <%end%>
538
+
539
+ </li>
540
+
541
+ <li class="nav-item">
542
+
543
+ <!-- About -->
544
+
545
+ <%= link_to new_user_session_path ,class: "nav-link text-white" do%>
546
+
547
+ <%= fa_icon "link" %> About
548
+
549
+ <%end%>
550
+
551
+ </li>
552
+
553
+ <li class="nav-item">
554
+
555
+ <!-- Sign up -->
556
+
557
+ <%= link_to new_user_registration_path ,class: "nav-link text-white" do%>
558
+
559
+ <%= fa_icon "user-plus"%> sign up
560
+
561
+ <%end%>
562
+
563
+ </li>
564
+
565
+ <li class="nav-item">
566
+
567
+ <!-- Sign in -->
568
+
569
+ <%= link_to new_user_session_path ,class: "nav-link text-white" do%>
570
+
571
+ <%= fa_icon "sign-in" %> login
572
+
573
+ <%end%>
574
+
575
+ </li>
576
+
577
+ </ul>
578
+
579
+ <% end %>
580
+
581
+ </header>
582
+
583
+ ```
584
+
585
+
586
+
423
587
  他にも必要と思われるファイルがあれば追記しますのでコメントをお願いします。

1

誤字

2020/10/25 08:35

投稿

Leandro
Leandro

スコア3

test CHANGED
File without changes
test CHANGED
@@ -328,8 +328,6 @@
328
328
 
329
329
  @user = User.new(user_params)
330
330
 
331
- @user.profile_image_id = "no-image.png"
332
-
333
331
  @user.save
334
332
 
335
333
  end