質問編集履歴

1

誤ったviewを添付していたため、修正いたしました。

2021/07/19 08:56

投稿

carp
carp

スコア27

test CHANGED
File without changes
test CHANGED
@@ -32,42 +32,30 @@
32
32
 
33
33
  ```view
34
34
 
35
- <h2>User info</h2>
35
+ <h2 class="mt-3">New Book</h2>
36
36
 
37
- <%= attachment_image_tag user, :profile_image, format: "jpeg", fallback: "no_image.jpg", size: "100x100" %>
37
+ <%= form_with model: book, local:true do |f| %>
38
38
 
39
- <table class="table">
39
+ <div class="form-group">
40
40
 
41
- <tbody>
41
+ <%= f.label :Title %>
42
42
 
43
- <tr>
44
-
45
- <th>name</th>
46
-
47
- <th><%= user.name %></th>
48
-
49
- </tr>
50
-
51
- <tr>
52
-
53
- <th>introduction</th>
54
-
55
- <th><%= user.introduction %></th>
56
-
57
- </tr>
58
-
59
- </tbody>
60
-
61
- </table>
62
-
63
- <div class="row">
64
-
65
- <%= link_to edit_user_path(user.id), class:"btn btn-outline-secondary btn-block" do %>
43
+ <%= f.text_field :title,class:"form-control" %>
66
-
67
- <i class="fas fa-user-cog"></i>
68
-
69
- <% end %>
70
44
 
71
45
  </div>
72
46
 
47
+ <div class="form-group">
48
+
49
+ <%= f.label :Opinion %>
50
+
51
+ <%= f.text_area :body, class:"form-control"%>
52
+
53
+ </div>
54
+
55
+ <%= f.submit 'Create Book',class:"btn btn-success" %>
56
+
57
+ <% end %>
58
+
59
+
60
+
73
61
  ```