Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9016337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:58:18+00:00 2026-06-16T03:58:18+00:00

I’ve been following the railscast on endless page and had previously done the same

  • 0

I’ve been following the railscast on endless page and had previously done the same for will_paginate, but I’m getting errors however I try to implement it in my specific situation. The will_paginate gems works perfectly, as does the jQuery call to the dom as far as I can tell from reading the developer tools in Chrome. The issue is with what is being returned – rails doesn’t like it. Here’s some code:

In videos.js.coffee:

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()

In my 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 %>

In my shared partial, which is being rendered by users/index.erb.html

    <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 %>

This gives me the following error from my development log:

Completed 500 Internal Server Error in 15ms

ActionView::Template::Error (Missing partial videos/video with {:locale=>[:en], :formats=>[:js, :html], :handlers=>[:erb, :builder, :coffee]}.

So I then tried creating a views/videos/_video.js.erb partial with the same code as the users/index.js.erb file, but it then gives me the following error:

  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

and as you can see, it hasn’t actually rendered the _video partial either.

In case it’s of relevance, the instance variable @recently_added_video I’m trying to call is defined in the application_controller and works fine with the partial and will_paginate.

Can anyone help figure out what’s going wrong? Very confused! Thanks…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:58:20+00:00Added an answer on June 16, 2026 at 3:58 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
This could be a duplicate question, but I have no idea what search terms
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have been unable to fix a problem with Java Unicode and encoding. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.