質問編集履歴
1
情報追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -82,7 +82,33 @@
|
|
82
82
|
|
83
83
|
|
84
84
|
|
85
|
+
▼ヘルパーerror_message
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
```ruby
|
90
|
+
|
91
|
+
module ApplicationHelper
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
def error_message(resource, attr_name)
|
96
|
+
|
97
|
+
if resource.errors[attr_name].present?
|
98
|
+
|
99
|
+
%Q(<p class="error">#{ resource.errors.full_messages_for(attr_name).join('<br>')}</p>)
|
100
|
+
|
101
|
+
end.to_s.html_safe
|
102
|
+
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
|
107
|
+
```
|
108
|
+
|
109
|
+
|
110
|
+
|
85
|
-
▼
|
111
|
+
▼新規登録のController
|
86
112
|
|
87
113
|
|
88
114
|
|
@@ -230,7 +256,7 @@
|
|
230
256
|
|
231
257
|
|
232
258
|
|
233
|
-
▼
|
259
|
+
▼ログインのController
|
234
260
|
|
235
261
|
|
236
262
|
|