回答編集履歴
1
要求場所を誤ったので回答風に修正
answer
CHANGED
@@ -2,4 +2,20 @@
|
|
2
2
|
app>views>sessions>new.html.erb
|
3
3
|
ではなく、
|
4
4
|
app>views>registrations>new.html.erb
|
5
|
-
を
|
5
|
+
を確認してみてください。
|
6
|
+
|
7
|
+
usernameに変える場合は、以下の設定も忘れずに必要です。
|
8
|
+
```
|
9
|
+
# config/initializers/devise.rb
|
10
|
+
...
|
11
|
+
# ==> Configuration for any authentication mechanism
|
12
|
+
# Configure which keys are used when authenticating a user. The default is
|
13
|
+
# just :email. You can configure it to use [:username, :subdomain], so for
|
14
|
+
# authenticating a user, both parameters are required. Remember that those
|
15
|
+
# parameters are used only when authenticating and not when retrieving from
|
16
|
+
# session. If you need permissions, you should implement that in a before filter.
|
17
|
+
# You can also supply a hash where the value is a boolean determining whether
|
18
|
+
# or not authentication should be aborted when the value is not present.
|
19
|
+
# config.authentication_keys = [ :email ]
|
20
|
+
config.authentication_keys = [ :username ]
|
21
|
+
```
|