質問編集履歴

1

htmlの追記

2021/01/20 06:54

投稿

10susumu
10susumu

スコア1

test CHANGED
File without changes
test CHANGED
@@ -24,9 +24,245 @@
24
24
 
25
25
  }
26
26
 
27
-
27
+ ```
28
+
28
-
29
+ ### 追記修正
30
+
29
-
31
+ ```html
32
+
33
+ <div class="container">
34
+
35
+ <div class="row">
36
+
37
+ </div>
38
+
39
+ <h1 class="col-sm-6 text-center">兵力計算</h1>
40
+
41
+
42
+
43
+
44
+
45
+ <%= form_with model: @busho, url: main_index_path, local: true do |f| %>
46
+
47
+
48
+
49
+ <div id="enemy" class="form-group row col-sm-6 py-0 my-0" data-json = <%= @busho_json %> >
50
+
51
+ <%= f.label :name, '相手武将', {class:"col-3 col-form-label text-nowrap"} %>
52
+
53
+ <div class="col-6">
54
+
55
+ <%= f.collection_select(:enemy_id, @busho, :bu_id, :name, {}, {class:"form-control form-control-sm", id:"enemy_id"}) %>
56
+
57
+ </div>
58
+
59
+ <span class="col-3 text-nowrap" id="enemy_sen"><%= @senjutsu %></span>
60
+
61
+ </div>
62
+
63
+ <div id="ally" class="form-group row col-sm-6 py-0 my-0">
64
+
65
+ <%= f.label :name, '味方武将', {class:"col-3 col-form-label text-nowrap"} %>
66
+
67
+ <div class="col-6">
68
+
69
+ <%= f.collection_select(:busho_id, Busho.all, :bu_id, :name, {}, {class:"form-control form-control-sm", id:"ally_id"}) %>
70
+
71
+ </div>
72
+
73
+ <span class="col-3 text-nowrap" id="ally_sen"><%= @senjutsu %></span>
74
+
75
+ </div>
76
+
77
+
78
+
79
+ <div class="form-group row col-sm-6 py-0 my-0" id="enemy_power">
80
+
81
+ <%= f.label :name, '相手兵力', {class:"col-3 col-form-label text-nowrap"} %>
82
+
83
+ <div class="col">
84
+
85
+ <%= f.number_field :float, class:"min form-control form-control-sm block", id:"min", placeholder:"下限" %>
86
+
87
+ <%= f.number_field :float, class:"max form-control form-control-sm block", id:"max", placeholder:"上限" %>
88
+
89
+ </div>
90
+
91
+ </div>
92
+
93
+ <div class="form-group row col-sm-6 py-0 my-0" id="kishu">
94
+
95
+ <%= f.label :name, '奇襲効果', {class:"col-3 col-form-label text-nowrap"} %>
96
+
97
+ <div class="col">
98
+
99
+ <%= f.select :kishu, [["-0%", 0], ["-30%", 0.3], ["-60%", 0.6], ["-100%", 1]], {}, {class:"form-control form-control-sm", id:"busho_kishu"} %>
100
+
101
+ </div>
102
+
103
+ </div>
104
+
105
+
106
+
107
+
108
+
109
+ <div id="">
110
+
111
+ <%= f.submit "計算" ,class:"col-sm-6 btn btn-sm btn-outline-primary btn-block my-0", id:"btn" %>
112
+
113
+ </div>
114
+
115
+ <% end %>
116
+
117
+
118
+
119
+ <table class="col-sm-6 mt-2 text-center text-nowrap" border="2">
120
+
121
+ <thead>
122
+
123
+ <tr>
124
+
125
+ <th></th>
126
+
127
+ <th>敵将アリ</th>
128
+
129
+ <th>敵将ナシ</th>
130
+
131
+ </tr>
132
+
133
+ </thead>
134
+
135
+ <tbody>
136
+
137
+ <tr>
138
+
139
+ <th>味方<br>アリ</th>
140
+
141
+ <td>
142
+
143
+ <table class="col text-center text-nowrap">
144
+
145
+ <tr>
146
+
147
+ <th>有利</th>
148
+
149
+ <th>同値</th>
150
+
151
+ <th>不利</th>
152
+
153
+ </tr>
154
+
155
+ <tr>
156
+
157
+ <td><span id="tab0">-</span></td>
158
+
159
+ <td><span id="tab1">-</span></td>
160
+
161
+ <td><span id="tab2">-</span></td>
162
+
163
+ </tr>
164
+
165
+ </table>
166
+
167
+ </td>
168
+
169
+ <td>
170
+
171
+ <table class="col text-center text-nowrap">
172
+
173
+ <tr>
174
+
175
+ <th>有利</th>
176
+
177
+ <th>同値</th>
178
+
179
+ <th>不利</th>
180
+
181
+ </tr>
182
+
183
+ <tr>
184
+
185
+ <td><span id="tab3">-</span></td>
186
+
187
+ <td><span id="tab4">-</span></td>
188
+
189
+ <td><span id="tab5">-</span></td>
190
+
191
+ </tr>
192
+
193
+ </table>
194
+
195
+ </td>
196
+
197
+ </tr>
198
+
199
+ <tr>
200
+
201
+ <th>味方<br>ナシ</th>
202
+
203
+ <td>
204
+
205
+ <table class="col text-center text-nowrap">
206
+
207
+ <tr>
208
+
209
+ <th>有利</th>
210
+
211
+ <th>同値</th>
212
+
213
+ <th>不利</th>
214
+
215
+ </tr>
216
+
217
+ <tr>
218
+
219
+ <td><span id="tab6">-</span></td>
220
+
221
+ <td><span id="tab7">-</span></td>
222
+
223
+ <td><span id="tab8">-</span></td>
224
+
225
+ </tr>
226
+
227
+ </table>
228
+
229
+ </td> <td>
230
+
231
+ <table class="col text-center text-nowrap">
232
+
233
+ <tr>
234
+
235
+ <th>有利</th>
236
+
237
+ <th>同値</th>
238
+
239
+ <th>不利</th>
240
+
241
+ </tr>
242
+
243
+ <tr>
244
+
245
+ <td><span id="tab9">-</span></td>
246
+
247
+ <td><span id="tab10">-</span></td>
248
+
249
+ <td><span id="tab11">-</span></td>
250
+
251
+ </tr>
252
+
253
+ </table>
254
+
255
+ </td>
256
+
257
+ </tr>
258
+
259
+ </tbody>
260
+
261
+ </table>
262
+
263
+
264
+
265
+ </div>
30
266
 
31
267
  ```
32
268