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

質問編集履歴

2

追記部分

2020/08/25 14:48

投稿

susume
susume

スコア13

title CHANGED
File without changes
body CHANGED
@@ -19,6 +19,8 @@
19
19
  ちなみに参考にしている記事は、以下の記事のセレクトボックスを表示するです。
20
20
  https://qiita.com/kenzoukenzou104809/items/07f6b5f7fdcf2761ac8f
21
21
 
22
+
23
+ 【追記】
22
24
  ##該当コード
23
25
  _form.haml.html
24
26
  ```

1

エラーコードの追記

2020/08/25 14:48

投稿

susume
susume

スコア13

title CHANGED
File without changes
body CHANGED
@@ -17,4 +17,47 @@
17
17
  みたいに書くのはできるんですが、それよりも高度なコードになっているので、なかなか自分で実装できずに困っています。
18
18
 
19
19
  ちなみに参考にしている記事は、以下の記事のセレクトボックスを表示するです。
20
- https://qiita.com/kenzoukenzou104809/items/07f6b5f7fdcf2761ac8f
20
+ https://qiita.com/kenzoukenzou104809/items/07f6b5f7fdcf2761ac8f
21
+
22
+ ##該当コード
23
+ _form.haml.html
24
+ ```
25
+ = form_for(@post) do |f|
26
+ .field
27
+ .field-label
28
+ = f.label :title, "snowB"
29
+ .field-input
30
+ = f.text_field :title
31
+ .field
32
+ .field-label
33
+ = f.label :body, "ココがポイント!"
34
+ .field-input
35
+ = f.text_area :body
36
+ .field
37
+ .field-label
38
+ = f.label :image, "snowB写真"
39
+ .field-input
40
+ = f.attachment_field :image
41
+ .category
42
+ = render partial: "category"
43
+ .actions
44
+ = f.submit "投稿する", class: "btn"
45
+ ```
46
+ _category.haml.html
47
+ ```
48
+ .categorySelect
49
+ %select#pararent_category
50
+ - @parent_categoryies.each do |c|
51
+ = options_for_select([['= c.id', =c.name]])
52
+ ```
53
+
54
+ ##エラー文
55
+
56
+ ```
57
+ _category.html.haml:4: syntax error, unexpected '=', expecting ']' ...ptions_for_select([['= c.id', =c.name]]) ... ^
58
+ _category.html.haml:4: syntax error, unexpected ']', expecting ')' ...for_select([['= c.id', =c.name]]) ... ^
59
+ _category.html.haml:5: syntax error, unexpected keyword_end, expecting ')' ...t.buffer << ("\n".freeze);; end;; _hamlout.buffer << ("</sel... ... ^~~
60
+ _category.html.haml:5: syntax error, unexpected keyword_ensure, expecting ')' ...:Util.html_safe(_erbout);ensure;@haml_buffer = @haml_buffer.... ... ^~~~~~
61
+ _category.html.haml:5: syntax error, unexpected keyword_end, expecting ')' ...uffer.upper if @haml_buffer;end; ... ^~~
62
+ _category.html.haml:8: syntax error, unexpected keyword_end, expecting ')' end ^~~
63
+ ```