저는 끝 페이지에 railscast을 따라 갔고 이전에는 will_paginate에 대해 동일한 작업을 수행했지만 오류가 발생합니다. 그러나 특정 상황에서이 문제를 구현하려고합니다. will_paginate 보석은 완벽하게 작동합니다. Chrome에서 개발자 도구를 읽는 것에서부터 jQuery가 dom에 전화를 걸 때까지는 마찬가지입니다. 문제는 반환되는 것입니다. 레일은 그것을 좋아하지 않습니다. 이 날을 제공 users/index.erb.html
will_paginate가 끝이없는 페이지가 부분적으로 작동하지 않습니다.
<div class="carousel" %>
<ul class="jcarousel-skin-recent">
<% @recently_added_video.each do |v| %>
<li><%= link_to image_tag(v.video_thumb(), width: 300), v %></li>
<% end %>
</ul>
</div>
<%= will_paginate @recently_added_video %>
에 의해 렌더링되는 부분 공유 내에서
내 views/users/index.js.erb
$('.carousel').append(' <%= j render(@recently_added_video) %>');
<% if @recently_added_video .next_page %>
$('.pagination').replaceWith('<%= j will_paginate(@recently_added_video) %>');
<% else %>
$('.pagination').remove();
<% end %>
에서
jQuery ->
if $('.pagination').length
$(window).scroll ->
url = $('.pagination .next_page').attr('href')
if url && $(window).scrollTop() > $(document).height() - $(window).height() - 50
$('.pagination').text("Fetching more videos...")
$.getScript(url)
$(window).scroll()
:
videos.js.coffee
에서 : 여기에 몇 가지 코드입니다 내 개발 로그에서 다음 오류 :
Completed 500 Internal Server Error in 15ms
ActionView::Template::Error (Missing partial videos/video with {:locale=>[:en], :formats=>[:js, :html], :handlers=>[:erb, :builder, :coffee]}.
그래서 나는 다음 users/index.js.erb
파일과 같은 코드를 가진 views/videos/_video.js.erb
부분을 작성했지만, 그 다음 나에게 다음과 같은 오류 제공 :
Rendered shared/_recentlyadded.html.erb (853.8ms)
Rendered users/index.html.erb within layouts/application (1741.4ms)
Rendered layouts/_header.html.erb (2.6ms)
Rendered layouts/_footer.html.erb (0.0ms)
Completed 200 OK in 1813ms (Views: 1801.0ms | ActiveRecord: 8.5ms | Sphinx: 0.0ms)
Illegal instruction: 4
을 당신이 볼 수 있듯이, 그것은하지 않은 실제로 _video
중 하나가 렌더링되었습니다.
관련성이있는 경우 인스턴스 변수 @recently_added_video
이 (가) application_controller
에 정의되어 있고 partial 및 will_paginate
에서 올바르게 호출됩니다.
아무도 잘못 될지 파악할 수 있습니까? 매우 혼란! 감사합니다 ...