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

質問編集履歴

1

調べた結果、modelのclass名がRailsの命名規則に反してたのでAfterBirthに変更したがエラーは解決できていません。

2021/03/04 05:54

投稿

masa503
masa503

スコア0

title CHANGED
File without changes
body CHANGED
@@ -22,7 +22,8 @@
22
22
  <%= f.text_area :text %>
23
23
  </div>
24
24
  <div class= "field">
25
- <%= f.collection_select(:after_birth_id, After_birth.all, :id, :name, {}, {class:"genre-select"}) %>
25
+ <%= f.collection_select(:after_birth_id, AfterBirth.all, :id, :name, {}, {class:"genre-select"}) %>
26
+ # After_birthからAfterBirthに変更
26
27
  </div>
27
28
  <%= f.submit "投稿する" %>
28
29
  <% end %>
@@ -33,7 +34,8 @@
33
34
  ### after_birth.rb ActiveHashモデル
34
35
  ```
35
36
 
36
- class After_birth < ActiveHash::Bace
37
+ class AfterBirth < ActiveHash::Bace
38
+ # class After_birthからAfterBirthに変更
37
39
  self.data = [
38
40
  { id: 1, name: '--' },
39
41
  { id: 2, name: '生後0ヶ月' },