Will_paginate and RJS

Hi
What my problem is I have a controller action and this action has
content for the various tabs of the view .Some
attchments,activities,resolutions etc…And this file is called only once
and all the other is planning in the ajax way .The controller code is
def show_details()
@sd_ticket=ServiceDeskTicket.find(params[:id])
@sd_attachments=service_desk_ticket.service_desk_attachments.display_sd_attachments(params[:page])
@sd_activities=ServiceDeskActivity.find_all_by_service_desk_ticket_id(@sd_ticket)

Here also i have introduce pagination as above this is the second tab

in the view
--------code for other tabs
end

And for the first in the ServiceeskAttachment.rb model file i wrote
def self.display_sd_attachments(page)
paginate :per_page => 5, :page => page
end
So the pagination is working .The view partial has <%= will_paginate
@sd_attachments%>

But from now onwards what my yet to be solved comes…What i need is
clicking on page 2,3 etc i have to invoke an ajax call and only tat
tab get updated to the required page.And I could implement it with
the rails pagination as below
<%= link_to_remote(‘Previous’, {:url => {:action =>
:show_attachment_page, :ci => @ci.id, :content => ‘show’, :page =>
@hardware_ci_attachments_pages.current.previous}}) if
@hardware_ci_attachments_pages.current.previous %> same for next
page…But I want to avoid this since this pagination is obsolete.

So as above how can i specify an action with will_paginate (which is
another action handling the ajax ) so what i am trying to do is inside
that action i can do the pagination and use RJS to replace this partial
file…Actually I understood responds_to now…So please help me…And i am
not an expert with ajax

Sijo

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