質問編集履歴
2
文法の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -173,3 +173,89 @@
|
|
173
173
|
|
174
174
|
|
175
175
|
```
|
176
|
+
|
177
|
+
追記 players_controller.rb
|
178
|
+
|
179
|
+
```ここに言語を入力
|
180
|
+
|
181
|
+
class PlayersController < ApplicationController
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
def show
|
186
|
+
|
187
|
+
@player = Player.find params[:id]
|
188
|
+
|
189
|
+
end
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
def create
|
196
|
+
|
197
|
+
@team = Team.find params[:team_id]
|
198
|
+
|
199
|
+
@team.players.create(player_params)
|
200
|
+
|
201
|
+
redirect_to team_path(@team)
|
202
|
+
|
203
|
+
end
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
def destroy
|
208
|
+
|
209
|
+
@team = Team.find params[:team_id]
|
210
|
+
|
211
|
+
@player = @team.players.find params[:id]
|
212
|
+
|
213
|
+
@player.destroy
|
214
|
+
|
215
|
+
redirect_to team_path(@team)
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
end
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
def player_params
|
224
|
+
|
225
|
+
params.require(:player).permit(:name, :body, :image)
|
226
|
+
|
227
|
+
end
|
228
|
+
|
229
|
+
end
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
```
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
(players)show.html.erb
|
238
|
+
|
239
|
+
```ここに言語を入力
|
240
|
+
|
241
|
+
<h2>High Light</h2>
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
<h3><%= @player.name %><br></h3>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
<iframe width="640" height="480" src="https://www.youtube-nocookie.com/embed/13YeR5zIGbo?start=109" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><br>
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
<%= link_to 'Player List', teams_path %>
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
```
|
1
文法
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
初心者なのでうまく説明でき
|
13
|
+
初心者なのでうまく説明できず申し訳ございません。
|
14
14
|
|
15
15
|
一度相互関係を作ったものから選手の名前を抜き出し個々にハイライトをつけたいと思っております。
|
16
16
|
|