回答編集履歴
2
追記
answer
CHANGED
@@ -62,4 +62,10 @@
|
|
62
62
|
params.require(:doctor).permit(:doctor_name, :email, :password)
|
63
63
|
end
|
64
64
|
end
|
65
|
+
```
|
66
|
+
|
67
|
+
# 追記
|
68
|
+
`config/initializers/devise.rb`に以下の記述はありますか?
|
69
|
+
```
|
70
|
+
config.scoped_views = true
|
65
71
|
```
|
1
修正箇所提示
answer
CHANGED
@@ -31,4 +31,35 @@
|
|
31
31
|
params.require(:doctor).permit(:doctor_name, :email, :password)
|
32
32
|
end
|
33
33
|
end
|
34
|
+
```
|
35
|
+
```diff
|
36
|
+
class DoctorsController < ApplicationController
|
37
|
+
def index
|
38
|
+
end
|
39
|
+
|
40
|
+
def new
|
41
|
+
@doctor = Doctor.new
|
42
|
+
end
|
43
|
+
|
44
|
+
def create
|
45
|
+
@doctor = Doctor.new(doctor_params)
|
46
|
+
if @doctor.save
|
47
|
+
redirect_to doctor_path
|
48
|
+
else
|
49
|
+
render 'new'
|
50
|
+
end
|
51
|
+
+ end #add end
|
52
|
+
|
53
|
+
def show
|
54
|
+
- @doctor = Doctor.find([:id]) #doctor typo
|
55
|
+
end
|
56
|
+
|
57
|
+
- end #remove end
|
58
|
+
|
59
|
+
|
60
|
+
private
|
61
|
+
def doctor_params
|
62
|
+
params.require(:doctor).permit(:doctor_name, :email, :password)
|
63
|
+
end
|
64
|
+
end
|
34
65
|
```
|