質問編集履歴
1
コードブロック内にコードを記載
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
```
|
13
|
+
```ruby:
|
14
14
|
|
15
15
|
@tournament = Tournament.new(tournament_params) ←これがマークされている
|
16
16
|
|
@@ -19,6 +19,8 @@
|
|
19
19
|
|
20
20
|
|
21
21
|
#controller コード
|
22
|
+
|
23
|
+
```ruby:tournaments.rb
|
22
24
|
|
23
25
|
class TournamentsController < ApplicationController
|
24
26
|
|
@@ -74,17 +76,25 @@
|
|
74
76
|
|
75
77
|
end
|
76
78
|
|
79
|
+
```
|
80
|
+
|
77
81
|
|
78
82
|
|
79
83
|
#routes コード
|
84
|
+
|
85
|
+
```ruby:routes.rb
|
80
86
|
|
81
87
|
root to: "tournaments#index"
|
82
88
|
|
83
89
|
resources :tournaments, only: [:index,:new,:create]
|
84
90
|
|
91
|
+
```
|
92
|
+
|
85
93
|
|
86
94
|
|
87
95
|
#view コード
|
96
|
+
|
97
|
+
```ruby:new.html.erb
|
88
98
|
|
89
99
|
<%= form_with model: @tournament, local: true do |f| %>
|
90
100
|
|
@@ -101,3 +111,5 @@
|
|
101
111
|
|
102
112
|
|
103
113
|
以下省略
|
114
|
+
|
115
|
+
```
|