質問編集履歴
2
追記部分
test
CHANGED
File without changes
|
test
CHANGED
@@ -39,6 +39,10 @@
|
|
39
39
|
https://qiita.com/kenzoukenzou104809/items/07f6b5f7fdcf2761ac8f
|
40
40
|
|
41
41
|
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
【追記】
|
42
46
|
|
43
47
|
##該当コード
|
44
48
|
|
1
エラーコードの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -37,3 +37,89 @@
|
|
37
37
|
ちなみに参考にしている記事は、以下の記事のセレクトボックスを表示するです。
|
38
38
|
|
39
39
|
https://qiita.com/kenzoukenzou104809/items/07f6b5f7fdcf2761ac8f
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
##該当コード
|
44
|
+
|
45
|
+
_form.haml.html
|
46
|
+
|
47
|
+
```
|
48
|
+
|
49
|
+
= form_for(@post) do |f|
|
50
|
+
|
51
|
+
.field
|
52
|
+
|
53
|
+
.field-label
|
54
|
+
|
55
|
+
= f.label :title, "snowB"
|
56
|
+
|
57
|
+
.field-input
|
58
|
+
|
59
|
+
= f.text_field :title
|
60
|
+
|
61
|
+
.field
|
62
|
+
|
63
|
+
.field-label
|
64
|
+
|
65
|
+
= f.label :body, "ココがポイント!"
|
66
|
+
|
67
|
+
.field-input
|
68
|
+
|
69
|
+
= f.text_area :body
|
70
|
+
|
71
|
+
.field
|
72
|
+
|
73
|
+
.field-label
|
74
|
+
|
75
|
+
= f.label :image, "snowB写真"
|
76
|
+
|
77
|
+
.field-input
|
78
|
+
|
79
|
+
= f.attachment_field :image
|
80
|
+
|
81
|
+
.category
|
82
|
+
|
83
|
+
= render partial: "category"
|
84
|
+
|
85
|
+
.actions
|
86
|
+
|
87
|
+
= f.submit "投稿する", class: "btn"
|
88
|
+
|
89
|
+
```
|
90
|
+
|
91
|
+
_category.haml.html
|
92
|
+
|
93
|
+
```
|
94
|
+
|
95
|
+
.categorySelect
|
96
|
+
|
97
|
+
%select#pararent_category
|
98
|
+
|
99
|
+
- @parent_categoryies.each do |c|
|
100
|
+
|
101
|
+
= options_for_select([['= c.id', =c.name]])
|
102
|
+
|
103
|
+
```
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
##エラー文
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
```
|
112
|
+
|
113
|
+
_category.html.haml:4: syntax error, unexpected '=', expecting ']' ...ptions_for_select([['= c.id', =c.name]]) ... ^
|
114
|
+
|
115
|
+
_category.html.haml:4: syntax error, unexpected ']', expecting ')' ...for_select([['= c.id', =c.name]]) ... ^
|
116
|
+
|
117
|
+
_category.html.haml:5: syntax error, unexpected keyword_end, expecting ')' ...t.buffer << ("\n".freeze);; end;; _hamlout.buffer << ("</sel... ... ^~~
|
118
|
+
|
119
|
+
_category.html.haml:5: syntax error, unexpected keyword_ensure, expecting ')' ...:Util.html_safe(_erbout);ensure;@haml_buffer = @haml_buffer.... ... ^~~~~~
|
120
|
+
|
121
|
+
_category.html.haml:5: syntax error, unexpected keyword_end, expecting ')' ...uffer.upper if @haml_buffer;end; ... ^~~
|
122
|
+
|
123
|
+
_category.html.haml:8: syntax error, unexpected keyword_end, expecting ')' end ^~~
|
124
|
+
|
125
|
+
```
|