Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save richardsondx/2305099 to your computer and use it in GitHub Desktop.
Save richardsondx/2305099 to your computer and use it in GitHub Desktop.
Endless page won't work with partial call instead of @render (which display my post with no css style)
<% for micropost in @microposts %>
<tr>
<td class="tdeux"><div class="head1"><%= image_tag("#{ micropost.to_guys ? "guys" : "girl" }-head.png") %></div></td>
<td valign="top"><p class="peopleposts"><%= link_to micropost.content, page_path(micropost) %></p></td>
<td class="td2"><div class="share1"><%= tweet_button(:via => "hmdy", :url => "http://localhost:3000/pages/#{micropost.id}", :text => "#{@micropost.content}", :lang => "en", :related => "helpmedateyou", :count => "none") %></div></td>
</tr>
<% end %>
<table>
<thead>
<tr>
<th><h2>Who?</h2><th>
<th><h2>What they said?</h2><th>
<th><h2></h2><th>
<tr>
<thead>
<div id="microposts">
<tbody>
<!-- The tutorial say to render @microposts ; however, I am loosing all the styles when i do that -->
<%= render 'microposts'%>
<tbody>
</div>
</table>
<%= will_paginate @microposts %>
$('#microposts').append('<%= j render(@microposts %>)');
$('.pagination').replaceWith('<%= j will_paginate(@microposts) %>');
<% for micropost in @microposts %>
<tr>
<td class="tdeux"><div class="head1"><%= image_tag("#{ micropost.to_guys ? "guys" : "girl" }-head.png") %></div><td>
<td valign="top"><p class="peopleposts"><%= link_to micropost.content, page_path(micropost) %></p><td>
<td class="td2"><div class="share1"><%= tweet_button(:via => "hmdy", :url => "http://localhost:3000/pages/#{micropost.id}", :text => "#{@micropost.content}", :lang => "en", :related => "helpmedateyou", :count => "none") %></div><td>
</tr>
<% end %>
<table>
<thead>
<tr>
<th><h2>Who?</h2><th>
<th><h2>What they said?</h2><th>
<th><h2></h2><th>
<tr>
<thead>
<div id="microposts">
<tbody>
<!-- The tutorial say to render @microposts ; however, I am loosing all the styles when i do that -->
<%= render 'microposts'%>
<tbody>
</div>
</table>
<%= will_paginate @microposts %>
$('#microposts').append('<%= j render(@microposts %>)');
$('.pagination').replaceWith('<%= j will_paginate(@microposts) %>');
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
# $('#inputtext').limit('140','#charsLeft');
jQuery ->
$(window).scroll ->
if $(window).scrollTop() > $(document).height() - $(window).height() - 50
$.getScript($('.pagination .next_page').attr('href'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment