Will Paginate

Hi,

I installed the will_paginate plugin and i used the coding below:

#controller

def show_tags
@tags = Tag.find(:all,:conditions => [‘name LIKE ?’,
‘%A’]).paginate(:per_page=>10, :page=>params[:page])
end

View show_tag

<%= render :partial => 'tags/registry_tags' %>

<%=will_paginate @tags ,:params => { :controller => ‘tags’, :action =>
‘update_tags’}%>

view tags/registry_tags

<[email protected] do|tag|%>

<%= tag.name%>
<%end%>

When i click on the will paginates, “Prev-next-1,2,…”, it goes to the
the controller side

def update_tags
render :update do |page|
page.replace_html “reg_data”,:partial=>“tags/registry_tags”
end
end

My problem is the div is not getting updated, like the way, a
link_to_remote would have worked. I am able to see all the div commands
and the expected data in a simple white screen after the second
pagination click. Am i missing a simple coding here?
Please help !!!

On Mar 28, 5:44am, Jeffrey B. [email protected] wrote:

My problem is the div is not getting updated, like the way, a
link_to_remote would have worked. I am able to see all the div commands
and the expected data in a simple white screen after the second
pagination click. Am i missing a simple coding here?
Please help !!!

will_paginate doesn’t generate ajax links by default. You can write a
custom link renderer that does however (I think there are a few
examples floating around of how to do this)

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs