Endless page with will_paginate not working with partial

笑着哭i 提交于 2019-12-04 15:51:24

Nevermind - I figured this out.

The problem was with this line

$('.carousel').append( ' <%= j render(@recently_added_video) %>' );

in the users/index.js.erb file.

I was following the railscast, but Ryan Bates has his instance variable set up to render a partial, so his code works, but because @recently_added_video isn't a partial and won't render one, it was returning the 500 error because there was no partial to find.

What I needed to do was actually render a partial like this:

 $('.jcarousel-skin-recent').append(' <%= j render ('shared/recentlyadded') %>');

Hope that helps anyone else who follows the railscast and has issues like I did.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!