<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Pagination in Ruby On Rails using will_paginate plugin</title>
	<atom:link href="http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/</link>
	<description>self.blog(social_network, ruby_on_rails, technology_options = {})</description>
	<pubDate>Mon, 07 Jul 2008 03:05:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
		<item>
		<title>By: nasir</title>
		<link>http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-705</link>
		<dc:creator>nasir</dc:creator>
		<pubDate>Fri, 20 Jun 2008 12:29:37 +0000</pubDate>
		<guid isPermaLink="false">http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-705</guid>
		<description>Nik

Yes you can.  In your view, instead of doing
&lt;code&gt; will_paginate object &lt;/code&gt;
do this
&lt;code&gt;
will_paginate(object, :next_label =&#62; "&#60;span class='class_name'&#62;Next label&#60;/span&#62;", :prev_label =&#62; "&#60;span class='class_name'&#62;Previous Label&#60;/span&#62;" ) 
&lt;/code&gt;

This will add css classes before your previous and next label.</description>
		<content:encoded><![CDATA[<p>Nik</p>
<p>Yes you can.  In your view, instead of doing<br />
<code> will_paginate object </code><br />
do this<br />
<code><br />
will_paginate(object, :next_label =&gt; "&lt;span class='class_name'&gt;Next label&lt;/span&gt;", :prev_label =&gt; "&lt;span class='class_name'&gt;Previous Label&lt;/span&gt;" )<br />
</code></p>
<p>This will add css classes before your previous and next label.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niksan</title>
		<link>http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-700</link>
		<dc:creator>Niksan</dc:creator>
		<pubDate>Fri, 20 Jun 2008 07:07:20 +0000</pubDate>
		<guid isPermaLink="false">http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-700</guid>
		<description>Hi Nasir!

I have used this pagination on one of the pages. I want to edit the styles for only the Previous or Next links. The current styles define a Link in a general way and have 2 styles 'current' and 'disabled' only for the two .

Is there a way to apply a separate css class to Previous and Next links?

Awaiting your reply.

Thanks in advance,
Nik</description>
		<content:encoded><![CDATA[<p>Hi Nasir!</p>
<p>I have used this pagination on one of the pages. I want to edit the styles for only the Previous or Next links. The current styles define a Link in a general way and have 2 styles &#8216;current&#8217; and &#8216;disabled&#8217; only for the two .</p>
<p>Is there a way to apply a separate css class to Previous and Next links?</p>
<p>Awaiting your reply.</p>
<p>Thanks in advance,<br />
Nik</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nasir</title>
		<link>http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-696</link>
		<dc:creator>nasir</dc:creator>
		<pubDate>Tue, 27 May 2008 05:58:05 +0000</pubDate>
		<guid isPermaLink="false">http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-696</guid>
		<description>Thanx Dave</description>
		<content:encoded><![CDATA[<p>Thanx Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nasir</title>
		<link>http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-695</link>
		<dc:creator>nasir</dc:creator>
		<pubDate>Tue, 27 May 2008 05:57:39 +0000</pubDate>
		<guid isPermaLink="false">http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-695</guid>
		<description>Hi ganesh,

You can join the two tables to get the result set and then use the pagination.</description>
		<content:encoded><![CDATA[<p>Hi ganesh,</p>
<p>You can join the two tables to get the result set and then use the pagination.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-691</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Thu, 22 May 2008 21:39:27 +0000</pubDate>
		<guid isPermaLink="false">http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-691</guid>
		<description>I had trouble installing the plugin on Windows, this page helped though: http://github.com/mislav/will_paginate/wikis/installation

Just leaving the link for others to find.l</description>
		<content:encoded><![CDATA[<p>I had trouble installing the plugin on Windows, this page helped though: <a href="http://github.com/mislav/will_paginate/wikis/installation" rel="nofollow">http://github.com/mislav/will_paginate/wikis/installation</a></p>
<p>Just leaving the link for others to find.l</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ganesh</title>
		<link>http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-690</link>
		<dc:creator>ganesh</dc:creator>
		<pubDate>Thu, 22 May 2008 10:53:05 +0000</pubDate>
		<guid isPermaLink="false">http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-690</guid>
		<description>Hi,
Is it possible to apply pagination for two objects

Eg: </description>
		<content:encoded><![CDATA[<p>Hi,<br />
Is it possible to apply pagination for two objects</p>
<p>Eg:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ganesh</title>
		<link>http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-689</link>
		<dc:creator>ganesh</dc:creator>
		<pubDate>Thu, 22 May 2008 10:52:08 +0000</pubDate>
		<guid isPermaLink="false">http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-689</guid>
		<description>Hi,
    Is it possible to apply pagination for two tables</description>
		<content:encoded><![CDATA[<p>Hi,<br />
    Is it possible to apply pagination for two tables</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nasir</title>
		<link>http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-688</link>
		<dc:creator>nasir</dc:creator>
		<pubDate>Tue, 20 May 2008 08:44:13 +0000</pubDate>
		<guid isPermaLink="false">http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-688</guid>
		<description>Sijo

The problem is in the class method of your model here 
:conditions =&#62; ["number LIKE ?", "%#{sd_ticket_number}%"]

if you change sd_ticket_number to search_sd_ui_hash then i think it should work fine because i cant see you getting a value for sd_ticket_number from anywhere though you are passing search_sd_ui_hash parameter to your class method in the model</description>
		<content:encoded><![CDATA[<p>Sijo</p>
<p>The problem is in the class method of your model here<br />
:conditions =&gt; ["number LIKE ?", "%#{sd_ticket_number}%"]</p>
<p>if you change sd_ticket_number to search_sd_ui_hash then i think it should work fine because i cant see you getting a value for sd_ticket_number from anywhere though you are passing search_sd_ui_hash parameter to your class method in the model</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sijo</title>
		<link>http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-687</link>
		<dc:creator>sijo</dc:creator>
		<pubDate>Tue, 20 May 2008 06:23:23 +0000</pubDate>
		<guid isPermaLink="false">http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-687</guid>
		<description>Hi
  I have a search UI.And I use will_paginate to paginate result.My action
is
def search_sd_ticket
   #@search_sd_ui_hash=params[:sd_ticket]
@search_sd_ticket_result=ServiceDeskTicket.record_paginate_sd(params[:sd_ticket],params[:page])

end

and in ServiceDeskTicket model

def self.record_paginate_sd(search_sd_ui_hash,page)
  def self.record_paginate_sd(search_sd_ui_hash,page)
  paginate(:page =&#62; page, :conditions =&#62; ["number LIKE ?",
"%#{sd_ticket_number}%"],
:per_page =&#62; 10,
:order =&#62; "number")

end

My problem is the first page comes but when i click on the next page the
following error happens
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[]

The second time params[:sd_ticket] has no value..ow can I solve
this?Please help

Sijo</description>
		<content:encoded><![CDATA[<p>Hi<br />
  I have a search UI.And I use will_paginate to paginate result.My action<br />
is<br />
def search_sd_ticket<br />
   #@search_sd_ui_hash=params[:sd_ticket]<br />
@search_sd_ticket_result=ServiceDeskTicket.record_paginate_sd(params[:sd_ticket],params[:page])</p>
<p>end</p>
<p>and in ServiceDeskTicket model</p>
<p>def self.record_paginate_sd(search_sd_ui_hash,page)<br />
  def self.record_paginate_sd(search_sd_ui_hash,page)<br />
  paginate(:page =&gt; page, :conditions =&gt; ["number LIKE ?",<br />
"%#{sd_ticket_number}%"],<br />
:per_page =&gt; 10,<br />
:order =&gt; &#8220;number&#8221 <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>end</p>
<p>My problem is the first page comes but when i click on the next page the<br />
following error happens<br />
You have a nil object when you didn&#8217;t expect it!<br />
You might have expected an instance of Array.<br />
The error occurred while evaluating nil.[]</p>
<p>The second time params[:sd_ticket] has no value..ow can I solve<br />
this?Please help</p>
<p>Sijo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nasir</title>
		<link>http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-684</link>
		<dc:creator>nasir</dc:creator>
		<pubDate>Fri, 02 May 2008 04:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://nasir.wordpress.com/2007/10/31/pagination-in-ruby-on-rails-using-will_paginate-plugin/#comment-684</guid>
		<description>You don't have to do any thing special for that in 
&lt;code&gt;
&#60;%= will_paginate @obj_instance %&#62;
&lt;/code&gt;
just provide the link normally like so:
&lt;code&gt;
&#60;%= link_to('A link', :controller =&#62; :jobs, :action =&#62; :index, :skill_type =&#62; 'ruby') %&#62;
&lt;/code&gt;
or if you are app is RESTful then
&lt;code&gt;
&#60;%= link_to('A link', jobs_path(:skill_type =&#62; 'ruby')) %&#62;
&lt;/code&gt;
If you have a page at http://www.example.com/jobs that uses pagination and can be accessed at http://www.example.com/jobs?page=2, http://www.example.com/jobs?page=3, etc then your skill_type parameter will be added in the URL, for instance, http://www.example.com/jobs?page=2&#38;skill_type=ruby That is, all your pagination urls will have an additional parameter of skill_type and its value attached to it.</description>
		<content:encoded><![CDATA[<p>You don&#8217;t have to do any thing special for that in<br />
<code><br />
&lt;%= will_paginate @obj_instance %&gt;<br />
</code><br />
just provide the link normally like so:<br />
<code><br />
&lt;%= link_to('A link', :controller =&gt; :jobs, :action =&gt; :index, :skill_type =&gt; 'ruby') %&gt;<br />
</code><br />
or if you are app is RESTful then<br />
<code><br />
&lt;%= link_to('A link', jobs_path(:skill_type =&gt; 'ruby')) %&gt;<br />
</code><br />
If you have a page at <a href="http://www.example.com/jobs" rel="nofollow">http://www.example.com/jobs</a> that uses pagination and can be accessed at <a href="http://www.example.com/jobs?page=2" rel="nofollow">http://www.example.com/jobs?page=2</a>, <a href="http://www.example.com/jobs?page=3" rel="nofollow">http://www.example.com/jobs?page=3</a>, etc then your skill_type parameter will be added in the URL, for instance, <a href="http://www.example.com/jobs?page=2&amp;skill_type=ruby" rel="nofollow">http://www.example.com/jobs?page=2&amp;skill_type=ruby</a> That is, all your pagination urls will have an additional parameter of skill_type and its value attached to it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
