I’m using the will_paginate plugin and I get the following error only when I’m running on a server rather than locally:
undefined method `total_pages' for []:Array Extracted source (around line #8): 5: <% session[:page] = params[:page] %> 6: <h2>Previous Scenario</h2> 7: <% end %> 8: <%= will_paginate @scenarios, :next_label => 'Older', :prev_label => 'Newer' %> 9: <div class='box'> 10: <% for scenario in @scenarios %> 11: <% @created = scenario.created_at %>
Any ideas?
Somehow,
@scenariosis an ordinary Array for you and it can’t be fromScenario.paginate()method because that one always returns aWillPaginate::Collectionobject.