質問編集履歴
2
msg add
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,7 +10,17 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
|
13
|
+
【2017/5/27追記】
|
14
|
+
|
15
|
+
どこを触ってしまったせいか、現在では独自パラメータ(codeまたはname)を1つでも追加したら登録出来なくなりました。
|
16
|
+
|
17
|
+
独自パラメータ無しの場合は、登録出来ます。
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
application_controller.rb
|
14
24
|
|
15
25
|
```ruby
|
16
26
|
|
@@ -72,9 +82,17 @@
|
|
72
82
|
|
73
83
|
|
74
84
|
|
75
|
-
|
85
|
+
【ソースとエラーメッセージ追加】
|
76
|
-
|
86
|
+
|
77
|
-
実行時の
|
87
|
+
実行時、最後の方に
|
88
|
+
|
89
|
+
「Filter chain halted as :require_no_authentication rendered or redirected
|
90
|
+
|
91
|
+
Completed 302 Found 」と、エラーらしきメッセージが出てます。
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
```dos
|
78
96
|
|
79
97
|
Started POST "/employees" for 127.0.0.1 at 2017-05-26 22:37:27 +0900
|
80
98
|
|
@@ -89,3 +107,101 @@
|
|
89
107
|
Filter chain halted as :require_no_authentication rendered or redirected
|
90
108
|
|
91
109
|
Completed 302 Found in 4ms (ActiveRecord: 0.2ms)
|
110
|
+
|
111
|
+
```
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
routes.rb
|
116
|
+
|
117
|
+
```ruby
|
118
|
+
|
119
|
+
Rails.application.routes.draw do
|
120
|
+
|
121
|
+
devise_for :employees
|
122
|
+
|
123
|
+
resources :employees
|
124
|
+
|
125
|
+
end
|
126
|
+
|
127
|
+
```
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
ビュー側
|
132
|
+
|
133
|
+
_form.html.erb
|
134
|
+
|
135
|
+
```ruby
|
136
|
+
|
137
|
+
<div class="field">
|
138
|
+
|
139
|
+
<%= f.label :email %><br />
|
140
|
+
|
141
|
+
<%= f.email_field :email, autofocus: true %>
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
<div class="field">
|
148
|
+
|
149
|
+
<%= f.label :password %>
|
150
|
+
|
151
|
+
<% if @minimum_password_length %>
|
152
|
+
|
153
|
+
<em>(<%= @minimum_password_length %> characters minimum)</em>
|
154
|
+
|
155
|
+
<% end %><br />
|
156
|
+
|
157
|
+
<%= f.password_field :password, autocomplete: "off" %>
|
158
|
+
|
159
|
+
</div>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
<div class="field">
|
164
|
+
|
165
|
+
<%= f.label :password_confirmation %><br />
|
166
|
+
|
167
|
+
<%= f.password_field :password_confirmation, autocomplete: "off" %>
|
168
|
+
|
169
|
+
</div>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
<div class="actions">
|
182
|
+
|
183
|
+
<%= f.submit %>
|
184
|
+
|
185
|
+
</div>
|
186
|
+
|
187
|
+
<% end %>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
```
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
new.html.erb
|
198
|
+
|
199
|
+
```ruby
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
<%= link_to 'Back', employees_path %>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
```
|
1
実行時のメッセージ
test
CHANGED
File without changes
|
test
CHANGED
@@ -69,3 +69,23 @@
|
|
69
69
|
|
70
70
|
|
71
71
|
宜しくお願い致します。
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
実行時のメッセージ
|
78
|
+
|
79
|
+
Started POST "/employees" for 127.0.0.1 at 2017-05-26 22:37:27 +0900
|
80
|
+
|
81
|
+
Processing by Devise::RegistrationsController#create as HTML
|
82
|
+
|
83
|
+
Parameters: {"utf8"=>"✓", "authenticity_token"=>"c25iAYc7fO7MdB4Ik3i1ljGByWd3F7zo7NX7z/ftf0YGTYbjwDvpP1aHl4Ac4VQvfk4338MJYvM35SCmHf2OTw==", "employee"=>{"code"=>"222", "name"=>"ほげさん", "email"=>"hoge@hoge.jp", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Create Employee"}
|
84
|
+
|
85
|
+
Employee Load (0.2ms) SELECT "employees".* FROM "employees" WHERE "employees"."id" = ? ORDER BY "employees"."id" ASC LIMIT ? [["id", 4], ["LIMIT", 1]]
|
86
|
+
|
87
|
+
Redirected to http://localhost:3000/
|
88
|
+
|
89
|
+
Filter chain halted as :require_no_authentication rendered or redirected
|
90
|
+
|
91
|
+
Completed 302 Found in 4ms (ActiveRecord: 0.2ms)
|