質問編集履歴
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,4 +10,44 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
+
該当部分となる`pictures_controller.rb`です。
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
```Ruby
|
18
|
+
|
19
|
+
def index
|
20
|
+
|
21
|
+
@pictures = Ckeditor.picture_adapter.find_all(ckeditor_pictures_scope).where(assetable_id: current_user.id)
|
22
|
+
|
23
|
+
@pictures = Ckeditor::Paginatable.new(@pictures).page(params[:page])
|
24
|
+
|
25
|
+
# respond_with(respond_with(@pictures, :layout => @pictures.first_page?)) do |format|
|
26
|
+
|
27
|
+
# format.html { render }
|
28
|
+
|
29
|
+
# end
|
30
|
+
|
31
|
+
respond_with(@pictures, :layout => @pictures.first_page?)
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
```
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
### エラー
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
* 上記のrespond_withは非推奨であるというエラーが出ます。
|
44
|
+
|
45
|
+
* indexメソッドの一番上でassetable_idをwhere句で検索していますが、デフォルトではassetable_idというカラムは存在しないので、えらーが出る。
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
13
53
|
こちらの機能を実装できた方いますでしょうか?
|