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

質問編集履歴

1

hamlファイル追加

2018/03/01 01:19

投稿

Koyyyyyy
Koyyyyyy

スコア55

title CHANGED
File without changes
body CHANGED
@@ -51,4 +51,44 @@
51
51
  });
52
52
 
53
53
  });
54
+ ```
55
+
56
+
57
+ form.html.haml↓  こちらに#user-search-fieldなど書いております。
58
+ ```
59
+ = form_for group do |f|
60
+ - if group.errors.any?
61
+ .chat-group-form__errors
62
+ %h2= "#{group.errors.full_messages.count}件のエラーが発生しました。"
63
+ %ul
64
+ - group.errors.full_messages.each do |message|
65
+ %li= message
66
+ .chat-group-form__field
67
+ .chat-group-form__field--left
68
+ = f.label :name, class: 'chat-group-form__label'
69
+ .chat-group-form__field--right
70
+ = f.text_field :name, class: 'chat__group_name chat-group-form__input', placeholder: 'グループ名を入力してください'
71
+ .chat-group-form__field.clearfix
72
+ / この部分はインクリメンタルサーチ(ユーザー追加の非同期化のときに使用します
73
+ .chat-group-form__field--left
74
+ %label.chat-group-form__label{:for => "chat_group_チャットメンバーを追加"} チャットメンバーを追加
75
+ .chat-group-form__field--right--search
76
+ .chat-group-form__search.clearfix
77
+ %input#user-search-field.chat-group-form__input{:placeholder => "追加したいユーザー名を入力してください", :type => "text", :name => "keyword"}/
78
+ .user-search-result
79
+
80
+
81
+ / この部分はインクリメンタルサーチ(ユーザー追加の非同期化のときに使用します
82
+ /
83
+ <div id='chat-group-users'>
84
+ <div class='chat-group-user clearfix' id='chat-group-user-22'>
85
+ <input name='chat_group[user_ids][]' type='hidden' value='22'>
86
+ <p class='chat-group-user__name'>seo_kyohei</p>
87
+ </div>
88
+ </div>
89
+ .chat-group-form__field.clearfix
90
+ .chat-group-form__field--left
91
+ .chat-group-form__field--right
92
+ = f.submit class: 'chat-group-form__action-btn'
93
+
54
94
  ```