質問編集履歴
3
controllerの追加しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -165,11 +165,40 @@
|
|
165
165
|
<% end %>
|
166
166
|
</div>
|
167
167
|
|
168
|
+
```
|
169
|
+
```ruby
|
170
|
+
class DoctorsController < ApplicationController
|
171
|
+
def index
|
172
|
+
end
|
168
173
|
|
174
|
+
def new
|
175
|
+
@doctor = Doctor.new
|
176
|
+
end
|
177
|
+
|
178
|
+
def create
|
179
|
+
@doctor = Doctor.new(doctor_params)
|
169
|
-
|
180
|
+
if @doctor.save
|
181
|
+
redirect_to doctor_path
|
182
|
+
else
|
170
|
-
|
183
|
+
render 'new'
|
184
|
+
end
|
185
|
+
|
186
|
+
def show
|
187
|
+
@doctorr = Doctor.find([:id])
|
188
|
+
|
189
|
+
end
|
190
|
+
|
191
|
+
end
|
192
|
+
|
193
|
+
|
194
|
+
private
|
171
|
-
|
195
|
+
def doctor_params
|
196
|
+
params.require(:doctor).permit(:doctor_name, :email, :password)
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
172
200
|
```
|
173
201
|
|
174
202
|
|
203
|
+
|
175
204
|
たくさんのコードになってしまいすみません。。。
|
2
controllerの追加しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -168,8 +168,7 @@
|
|
168
168
|
|
169
169
|
<% end %>
|
170
170
|
</div>
|
171
|
-
|
172
|
-
|
171
|
+
</div>
|
173
172
|
```
|
174
173
|
|
175
174
|
|
1
controllerの追加しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -165,6 +165,7 @@
|
|
165
165
|
<% end %>
|
166
166
|
</div>
|
167
167
|
|
168
|
+
|
168
169
|
<% end %>
|
169
170
|
</div>
|
170
171
|
|