質問編集履歴
1
問題の起きた箇所の追記、モデルについての詳細
test
CHANGED
File without changes
|
test
CHANGED
@@ -11,6 +11,88 @@
|
|
11
11
|
因みに、良く使われているja.ymlファイルの上に載せただけ。
|
12
12
|
|
13
13
|
|
14
|
+
|
15
|
+
問題の箇所のコード(エラーを表示する部分)
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
```
|
20
|
+
|
21
|
+
<%= stylesheet_link_tag "/assets/recruitments.css" %>
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
<div>
|
26
|
+
|
27
|
+
<div class="col-md-4 offset-md-4">
|
28
|
+
|
29
|
+
<h2 class="text-center pt-5">Apex Friendsを探そう!</h2>
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
<% if @recruitment.errors.any? %>
|
34
|
+
|
35
|
+
<div class="alert alert-warning">
|
36
|
+
|
37
|
+
<ul>
|
38
|
+
|
39
|
+
<% @recruitment.errors.full_messages.each do |message| %>
|
40
|
+
|
41
|
+
<li><%= message %></li>
|
42
|
+
|
43
|
+
<% end %>
|
44
|
+
|
45
|
+
</ul>
|
46
|
+
|
47
|
+
</div>
|
48
|
+
|
49
|
+
<% end %>
|
50
|
+
|
51
|
+
```
|
52
|
+
|
53
|
+
recruitmentモデルの構造
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
```
|
58
|
+
|
59
|
+
class CreateRecruitments < ActiveRecord::Migration[5.2]
|
60
|
+
|
61
|
+
def change
|
62
|
+
|
63
|
+
create_table :recruitments do |t|
|
64
|
+
|
65
|
+
t.string :mode, presence: true
|
66
|
+
|
67
|
+
t.string :rank, presence: true
|
68
|
+
|
69
|
+
t.string :use_chara, presence: true
|
70
|
+
|
71
|
+
t.string :need_chara, presence: true
|
72
|
+
|
73
|
+
t.string :play_style, presence: true
|
74
|
+
|
75
|
+
t.integer :flag, null: false, default: 0
|
76
|
+
|
77
|
+
t.integer :user_id
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
t.timestamps
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
```
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
ja.ymlに書いたコード
|
14
96
|
|
15
97
|
```
|
16
98
|
|