質問編集履歴
1
jsファイルの呼び出しがわのコード追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -313,3 +313,167 @@
|
|
313
313
|
|
314
314
|
|
315
315
|
を行いましたが変化はありませんでした。
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
#### 追記
|
320
|
+
|
321
|
+
message.jsを呼び出しているファイルです。
|
322
|
+
|
323
|
+
```
|
324
|
+
|
325
|
+
.messages
|
326
|
+
|
327
|
+
-if @messages
|
328
|
+
|
329
|
+
-@messages.each do |message|
|
330
|
+
|
331
|
+
.message{"data-message-id": "#{message.id}"}
|
332
|
+
|
333
|
+
-if message.user.id == current_user.id
|
334
|
+
|
335
|
+
.right
|
336
|
+
|
337
|
+
.right__message
|
338
|
+
|
339
|
+
%p.right__message__content
|
340
|
+
|
341
|
+
=safe_join(message.content.split("\n"),tag(:br))
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
.right__title
|
346
|
+
|
347
|
+
.right__title__date
|
348
|
+
|
349
|
+
= message.created_at.strftime("%Y年%m月%d日 %H時%M分")
|
350
|
+
|
351
|
+
-else
|
352
|
+
|
353
|
+
.left
|
354
|
+
|
355
|
+
.left__message
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
=image_tag asset_path(message.user.image)
|
360
|
+
|
361
|
+
%span.left__message__content
|
362
|
+
|
363
|
+
=safe_join(message.content.split("\n"),tag(:br))
|
364
|
+
|
365
|
+
.left__title
|
366
|
+
|
367
|
+
-if message.user
|
368
|
+
|
369
|
+
.left__title__name
|
370
|
+
|
371
|
+
= message.user.nickname
|
372
|
+
|
373
|
+
.left__title__date
|
374
|
+
|
375
|
+
= message.created_at.strftime("%Y年%m月%d日 %H時%M分")
|
376
|
+
|
377
|
+
%br/
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
.contents__footer
|
382
|
+
|
383
|
+
= form_for [@group, @message] do |f|
|
384
|
+
|
385
|
+
.input
|
386
|
+
|
387
|
+
= f.text_area :content, placeholder: "type a message",class: "input__text" ,required: true
|
388
|
+
|
389
|
+
= f.label :submit do
|
390
|
+
|
391
|
+
%i.fas.fa-paper-plane.icon
|
392
|
+
|
393
|
+
= f.submit class: "input__submit" ,id:'message_submit'
|
394
|
+
|
395
|
+
```
|
396
|
+
|
397
|
+
こちらのsubmitでイベントを発火させています。
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
また動的カテゴリーボックスの方は新規登録画面で使用しおり、本番環境では動きません。
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
```
|
408
|
+
|
409
|
+
registration/new
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
.form
|
414
|
+
|
415
|
+
= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
|
416
|
+
|
417
|
+
= render "devise/shared/error_messages", resource: resource ,class: 'error'
|
418
|
+
|
419
|
+
.form__field
|
420
|
+
|
421
|
+
ニックネーム
|
422
|
+
|
423
|
+
%br/
|
424
|
+
|
425
|
+
= f.text_field :nickname, autofocus: true, autocomplete: "nickname",required: true,class:'input'
|
426
|
+
|
427
|
+
.form__field
|
428
|
+
|
429
|
+
= f.label :email
|
430
|
+
|
431
|
+
%br/
|
432
|
+
|
433
|
+
= f.email_field :email, autocomplete: "email",required: true,class:'input'
|
434
|
+
|
435
|
+
.form__field
|
436
|
+
|
437
|
+
= f.label :password
|
438
|
+
|
439
|
+
- if @minimum_password_length
|
440
|
+
|
441
|
+
%em
|
442
|
+
|
443
|
+
(#{@minimum_password_length} 以上)
|
444
|
+
|
445
|
+
%br/
|
446
|
+
|
447
|
+
= f.password_field :password, autocomplete: "new-password" ,required: true,class:'input'
|
448
|
+
|
449
|
+
.form__field
|
450
|
+
|
451
|
+
= f.label :password_confirmation
|
452
|
+
|
453
|
+
%br/
|
454
|
+
|
455
|
+
= f.password_field :password_confirmation, autocomplete: "new-password" ,required: true,class:'input'
|
456
|
+
|
457
|
+
#InId.form__field
|
458
|
+
|
459
|
+
業界
|
460
|
+
|
461
|
+
%br/
|
462
|
+
|
463
|
+
= f.collection_select :industry_id, Industry.all.where(ancestry: nil).limit(14), :id, :name,{prompt: "選択してください"}, name: '',id: "Industry-form",selected:true,required:true
|
464
|
+
|
465
|
+
#OcId.form__field
|
466
|
+
|
467
|
+
職種
|
468
|
+
|
469
|
+
%br/
|
470
|
+
|
471
|
+
= f.collection_select :occupation_id, Occupation.all.where(ancestry: nil).limit(15), :id, :name,{prompt: "選択してください"}, name: '',id: "Occupation-form",selected:true,required:true
|
472
|
+
|
473
|
+
.actions
|
474
|
+
|
475
|
+
= f.submit "save",class:'save'
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
```
|