質問編集履歴
1
実現したいことを具体的に記載しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
という表示が出て、処理が失敗してしまいます。
|
8
8
|

|
9
9
|
|
10
|
-
エラーメッセージに含まれる「where」は、
|
10
|
+
エラーメッセージに含まれる「where」は、collection_selectで、formにてプルダウンリストを表示させるため、
|
11
11
|
コードマスタからwhereで条件に合うコードリストを取ってきている箇所で使用しています。
|
12
12
|
(<%= f.collection_select :area, code.where(code_id: "1"), :code, :name %>)
|
13
13
|
|
@@ -111,6 +111,19 @@
|
|
111
111
|
end
|
112
112
|
```
|
113
113
|
|
114
|
+
### コードマスタ(schema.rb)※抜粋
|
115
|
+
```Ruby
|
116
|
+
create_table "codes", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci", force: :cascade do |t|
|
117
|
+
t.string "code_id", null: false
|
118
|
+
t.string "sub_id", null: false
|
119
|
+
t.string "code", null: false
|
120
|
+
t.string "name"
|
121
|
+
t.datetime "created_at", null: false
|
122
|
+
t.datetime "updated_at", null: false
|
123
|
+
t.index ["code_id", "sub_id", "code"], name: "index_codes_on_code_id_and_sub_id_and_code", unique: true
|
124
|
+
end
|
125
|
+
```
|
126
|
+
|
114
127
|
不足情報等ございましたら、お手数をお掛けし恐れ入りますが、
|
115
128
|
ご指摘いただけますと幸いです。
|
116
129
|
何卒よろしくお願い申し上げます。
|