質問するログイン新規登録

回答編集履歴

1

要求場所を誤ったので回答風に修正

2016/02/12 15:45

投稿

miyamiya
miyamiya

スコア691

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
+ ```