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