# Pagination problem

**URL:** <https://www.ruby-forum.com/t/pagination-problem/138258>\
**Category:** Rails\
**Created:** [May 21, 2008, 1:34pm UTC](https://www.ruby-forum.com/t/pagination-problem/138258 "2008-05-21T13:34:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [May 21, 2008, 1:34pm UTC](https://www.ruby-forum.com/t/pagination-problem/138258/1 "2008-05-21T13:34:41Z")

</div>

Hi  
I have a partial file \_view\_sd\_attachments.rhtml.In that a  
link\_to\_remote is there also pagination code is there  
\<%= link\_to\_remote “Attach a file”,  
{:update =\> “view\_sd\_attachment”,  
:url =\> {:controller =\> ‘service\_desk’, :action =\>  
:attach\_file\_ui,  
:id =\> @sd\_ticket } },  
%\>  
And pagination as  
\<%= will\_paginate  
@sd\_attachments,:update=\>‘view\_sd\_attachment’,:params=\>{:controller=\>‘service\_desk’,:action=\>‘sd\_attachment\_pagination’,:sd\_id=\>@sd\_ticket},  
:container =\> false %\>

I am using pagination ajaxway .This is working…when i click on  
link\_to\_remote “Attach File” that page(attach\_file\_ui.rhtml) loads…Upto  
this everything ok…Now my problem starts.I have a cancel button in  
attach\_file\_ui file  
\<%= link\_to\_remote( “Cancel”,  
{:update =\> “sd\_attachment\_ui”,  
:url =\> {:controller =\> ‘service\_desk’, :action =\>  
‘sd\_attach\_file\_cancel’, :id =\> @sd\_ticket.id}},  
{:class =\> ‘itilbuttonlink1’}) %\>

def sd\_attach\_file\_cancel  
puts params[:page]  
@sd\_ticket= ServiceDeskTicket.find(params[:id])  
@sd\_attachments=@sd\_ticket.service\_desk\_attachments  
render :partial =\> ‘service\_desk\_part/view\_sd\_attachment\_details’,  
:locals =\> {:sd\_attachments =\> @sd\_attachments, :sd\_ticket =\>  
@sd\_ticket}  
end

But this gives the error  
Showing app/views/service\_desk\_part/\_view\_sd\_attachment\_details.rhtml  
where line #155 raised:  
undefined method `offset’ for ServiceDeskAttachment:Class

How can I solve this?Please help

Sijo
