質問編集履歴

1

追記

2017/07/26 04:59

投稿

Maar
Maar

スコア48

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,24 @@
1
1
  Rails 5でこのようなhas_many through関連でid以外(code)で関連付けをしたいのですが、うまくいきません。
2
2
 
3
3
  どのようにすればcodeで関連付けできるのでしょうか、こ教授いただきたいです。
4
+
5
+ ビューで支店(Branch)を選択するときにattributeをaccessible_branch_codesみたいな感じでやってみても
6
+
7
+ ```
8
+
9
+ undefined method `accessible_branch_codes' for #<User:
10
+
11
+ Did you mean? accessible_branch_ids
12
+
13
+ accessible_branches
14
+
15
+ accessible_branch_ids=
16
+
17
+ accessible_branches=
18
+
19
+ ```
20
+
21
+ と怒られてしまいます。
4
22
 
5
23
 
6
24