On 7 April 2012 20:47, Colin Law <clanlaw@googlemail.com> wrote:
> On 7 April 2012 20:07, Antony Shimmin <lists@ruby-forum.com> wrote:
>> Hi there,
>>
>> I have Ajax Pagination (sort of) working on my Ruby on Rails Project.
>>
>> However my problem is, is that it repeats each page x number of times, x
>> being equal to the amount of records I have on each page.
>>
>> So lets say for example prior to the Ajax Pagination, I had 12 records
>> per page, now I have each record on that page replicated 12 times.
>>
>> I render a partial as follows.
>>
>> <table width="500" border="1" align="center" class="gridtable" id="meh">
>> <tr id="table2">
>>
>> <th height="26" scope="col">Username</th>
>> <th scope="col">Date Leaving</th>
>> <th scope="col">Date Submitted</th>
>> <th scope="col">Approved</th>
>> <th scope="col">Date Updated</th>
>> </tr>
>> <% div_for for holidays in @holidays%>
>
> That should be "for holiday in" not "for holidays in"
>
> Have a look at the Rails Guide on Debugging, it will show you how to
> debug code so you can work out such problems yourself.
But even then I am not convinced it will work. What is the div_for
doing there? Since you have not got "<%= div_for" the div_for will
not actually produce any code. I think more likely you want something
like
<% @holidays.each do |holiday| %>
<%= div_for holiday do %>
Colin
>
>
> Colin
>
>> <tr>
>> <td><%= link_to holiday.user.username, holiday %></td>
>> <td><%= holiday.dateleaving%></td>
>> <td><%= time_ago_in_words(holiday.created_at) %></td>
>> <td><%= holiday.approved%></td>
>> <td><%= time_ago_in_words(holiday.updated_at) %></td>
>> </tr>
>> <% end %>
>> </table>
>>
>> Any ideas?
>>
>> --
>> Posted via http://www.ruby-forum.com/.
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
>> To post to this group, send email to rubyonrails-talk@googlegroups.com.
>> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
>> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>
>
>
> --
> gplus.to/clanlaw
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment