質問編集履歴

1

誤字

2017/11/09 10:55

投稿

dragogonone
dragogonone

スコア6

test CHANGED
File without changes
test CHANGED
@@ -92,13 +92,13 @@
92
92
 
93
93
  ###試したこと
94
94
 
95
- https://stackoverflow.com/questions/33229296/how-does-reactjs-handles-rails-active-record-associations
95
+ [https://stackoverflow.com/questions/33229296/how-does-reactjs-handles-rails-active-record-associations](https://stackoverflow.com/questions/33229296/how-does-reactjs-handles-rails-active-record-associations)
96
96
 
97
97
  を参考に、Controllerファイルでのモデル呼び出しの記述を
98
98
 
99
99
  ```ruby
100
100
 
101
- @articles = .as_json(include: {blog_tags: {only: [:tag_name]}})
101
+ @articles = Article.all.includes(:tags).as_json(include: { tags: { only: [:tag_name] } })
102
102
 
103
103
  ```
104
104