質問編集履歴
1
指摘に対する対応
test
CHANGED
File without changes
|
test
CHANGED
@@ -15,3 +15,91 @@
|
|
15
15
|
|
16
16
|
|
17
17
|
これは何が悪いのでしょうか?どなたかご存じの方よろしくお願いします。
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
【追記】
|
22
|
+
|
23
|
+
該当箇所のソースです。コントローラーはDeviseのソースそのままです。
|
24
|
+
|
25
|
+
/app/views/devise/sessions/new.html.slim
|
26
|
+
|
27
|
+
```
|
28
|
+
|
29
|
+
= stylesheet_link_tag params[:controller], :media => "all"
|
30
|
+
|
31
|
+
div#main.sign_in
|
32
|
+
|
33
|
+
.container
|
34
|
+
|
35
|
+
h1 = @test
|
36
|
+
|
37
|
+
h2
|
38
|
+
|
39
|
+
| Log in
|
40
|
+
|
41
|
+
= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
|
42
|
+
|
43
|
+
h3 = devise_error_messages!
|
44
|
+
|
45
|
+
dl.field
|
46
|
+
|
47
|
+
dt = f.label :email
|
48
|
+
|
49
|
+
dd = f.email_field :email, autofocus: true
|
50
|
+
|
51
|
+
dl.field
|
52
|
+
|
53
|
+
dt = f.label :password
|
54
|
+
|
55
|
+
dd = f.password_field :password, autocomplete: "off"
|
56
|
+
|
57
|
+
- if devise_mapping.rememberable?
|
58
|
+
|
59
|
+
div.field
|
60
|
+
|
61
|
+
= f.check_box :remember_me
|
62
|
+
|
63
|
+
= f.label :remember_me
|
64
|
+
|
65
|
+
.actions
|
66
|
+
|
67
|
+
= f.submit "Log in"
|
68
|
+
|
69
|
+
= render "devise/shared/links"
|
70
|
+
|
71
|
+
```
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/devise-4.2.0/app/controllers/devise/sessions_controller.rb
|
76
|
+
|
77
|
+
```
|
78
|
+
|
79
|
+
class Devise::SessionsController < DeviseController
|
80
|
+
|
81
|
+
prepend_before_action :require_no_authentication, only: [:new, :create]
|
82
|
+
|
83
|
+
prepend_before_action :allow_params_authentication!, only: :create
|
84
|
+
|
85
|
+
prepend_before_action :verify_signed_out_user, only: :destroy
|
86
|
+
|
87
|
+
prepend_before_action only: [:create, :destroy] { request.env["devise.skip_timeout"] = true }
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
# GET /resource/sign_in
|
92
|
+
|
93
|
+
def new
|
94
|
+
|
95
|
+
self.resource = resource_class.new(sign_in_params)
|
96
|
+
|
97
|
+
clean_up_passwords(resource)
|
98
|
+
|
99
|
+
yield resource if block_given?
|
100
|
+
|
101
|
+
respond_with(resource, serialize_options(resource))
|
102
|
+
|
103
|
+
end
|
104
|
+
|
105
|
+
```
|