neat!~
when rails go to 2.0?
anyone give me a messege?
Rails2.0什么时候发布啊(还是说中国话舒服^_^)
+1, great cast!
ф пятерке!
Using Rails Edge almoust month. It really rocks :).
Thats good railscast too. Just thought that i should search something about pagination tomorrow.
I've been using paginate_find and it works pretty well. Have any opinions/experience with that plugin?
The paginate in the model ability from will_paginate looks really cool.
@riki, not exactly sure what you're referring to. You can pass an ":order" option just like the "find" method so you can do any sorting you wish.
@dave, I haven't used paginating_find but it looks pretty good.
Does will_paginate do AJAX pagination? Paginating_find does not (currently) and if will_paginate can do this I may migrate to it.
@lisa, nope, AFAIK will_paginate doesn't offer anything special in regards to AJAX. You can still use the back end part of the plugin to manage the pagination, however, you may need to rewrite the view portion to use link_to_remote instead of normal links.
"kinda" rails related, but a short screencast of how you do your shortcut magic in textmate might be cool.
Lisa - it's pretty easy to write a helper to do your AJAX pagination. There's a good example in the (awesome) exception_logger plugin. It's designed for classic pagination, but something like this would work for will_paginate, too. Check it out: http://svn.techno-weenie.net/projects/plugins/exception_logger/lib/logged_exceptions_helper.rb
I could also write a helper for AJAX paginating links for paginating_find...
Wouldn't mind seeing how these two plugins stack up with each other.
I found an Ajax approach here that lets you "sort, search and paginate"
http://dev.nozav.org/ajaxtable/?sort=name
Is it wrong that I was giddy like a small child on Christmas day when I saw the new Railscast in my iTunes Podcasts directory? Thanks for all your awesome work on these podcasts!
Hi, I'm the main maintainer for the will_paginate plugin. Ryan, thanks a lot for this screencast! For the rest of you, you can get familiar with the plugin by generating the RDoc documentation; simply type "rake rdoc" while in the plugin directory.
If you want to report bugs or suggest features for this plugin, go to http://err.lighthouseapp.com/projects/466-plugins. Thanks!
That good ep. I wish you create episode about testing on rails. Thaink you
@lisa, with UJS it'd extremely simple to layer ajax pagination on top of will_paginate. Check out ujs4rails.com :)
thanks for pointing the way to will_paginate. however, i was trying to implement it to paginate "entries" that works with the "acts_as_taggable" plugin. i placed this in the entry model.
def self.taggedwith(tag, page)
paginate :conditions => ["tags.name=?",tag],
:joins => "INNER JOIN taggings ON entries.id = taggings.taggable_id INNER JOIN tags ON taggings.tag_id = tags.id",
:order=>"entries.created_at DESC",
:per_page => 10,
:page => page
end
while i do get the correct entries, the tag_list are always incorrect. could you suggest any workaround?
Great screencast as usual. I have learned so much from your podcasts that my rails abilities have improved considerably.
Unfortunately, the will_paginate plugin won't work with my version of rails (1.2.3). I'm not able to start mongrel, as I get "finder.rb:11:in `included': undefined method `alias_method_chain'". Shame as I really want to use it for an artists website that I'm redesigning.
Thanks again, Ryan. You are the man.
@Markus,
I've pointed out the link to submit bug reports to in my previous comment. And the error you're seeing *can't* be right because Rails 1.2 uses alias_method_chain internally all over the place! If you keep seeing the error, submit a proper report with more information. Thanks
I'm having trouble installing the will_paginate plugin using <code>script/plugin install svn://errtheblog.com/svn/plugins/classic_pagination</code>.
I keep getting a timeout error saying subversion can't connect to host 'errtheblog.com'. Anyone have any ideas? Is anyone else having this problem?
Thanks Ryan, this is the only thing I needed when I decided to move to the edge Rails!
Just a curiosity question: What the scaffolding in rails 2.0 will generate to paginate pages?
@Mahmoud, the scaffolding in edge Rails uses what is currently called scaffold_resource. This doesn't do any pagination.
That does mean a default RESTful design of applications ??
@Mahmoud, yep. The default scaffolding will be RESTful in Rails 2.0.
Great screencast, thanks a lot.
I'm using the will_paginate plugin myself for a while now and I really like it. However I've come across some problems while trying to paginate special queries (e.g. custom finder class-methods on your model). I've put up a summary in <a href="http://zargony.com/2007/07/21/paginating-special-queries/>this post in my blog</a>.
If I was gay I'd definitly would want to be your boyfriend!!!! Your casts are so seeeexy! For real!!!
THAT was gay ;)
I'm getting no response at all when attempting to install from this address...
svn://errtheblog.com/svn/plugins/will_paginate
Could there be a problem in Windows? I don't seem to have this problem with any other plugins?
@bilson, it's working for me. Is it still not working for you? Maybe Windows doesn't like the "svn" protocol. Not sure what the solution is.
My mistake. It is working now. I thought I could download via svn from the command line, but I have to do so directly through the Tortoise interface instead.
Great screencast. Great plugin.
你说中国话谁看的懂啊,sb啊
rails2。0早着呢
.. ... .
Hello,everybody!
to bbb:
其他人是看不懂中国话,不过还有你这个sb可以看得懂啊。
Mislav,
I modified view_helpers.rb to add clean and simple ajax support.
Look here http://batmanrails.blogspot.com/2007/10/ajax-support-for-willpaginate.html
-Batman
你說中国話,我說中國話...
@Ryan Bates,
Install will_paginate with svn:// not work to me too. After I install SVN command line this work
Hey,
I really need to get this thing to work wiht ajax, i need a link to remote to update a specific id and I can't get any info on how to do that...plus I am not very good with rails...can someone help out with this?
Ajaxify will_paginate
instruction left by @The Batman are outdated (already!). Err, or whomever maintains will_paginate, really needs to add Ajax support. Without this plugin is not "game-day" ready.
I hacked up a version that works for me but it's not publishable.
I would look for another paginator that supports Ajax before using this one.
Hello, I have will_paginate working with lowpro. It does ajax pagination just fine. Except that I have two partials in the same view, and I cannot figure out how to make each work separately. The first page renders fine, because each partial draws from a separate instance variable in the controller. But when you click on another page for each partial, each partial sends the same exact message to the controller. Each partial says "give me page two for this view", rather than "give me page two for this partial". Any hints?
this videocast was extremely helpful to me, thank you for your hard work.
Charles, try:
http://railsontherun.com/2007/9/27/ajax-pagination-in-less-than-5-minutes
If I have 100 pages how do I display pages 1 through 5 then .... and the last 5, 95 through 100?
Would anyone know how to use this in conjunction with form parameters? I have a form, the parameters of which go into my find / paginate function. This works fine for the first results page, but when a link is followed to subsequent pages, the search parameters are lost. Is there a way to pass a parameters hash via the will_paginate helper method in the view???
The problem is explained in more detail here:
http://www.railsforum.com/viewtopic.php?id=14604
@Ned, will_paginate should automatically pass the params. Make sure to use GET request in your search form along with the helper methods which end in "_tag" (such as "text_field_tag" and "check_box_tag"). See this episode for details:
http://railscasts.com/episodes/37
Thanks for the reply Ryan - I'll check this out when I get the chance - I think I might be using different form helper methods, which might explain why the parameters aren't passed...
Thank you for this video.
I am having a problem displaying my data in the view side, I am using partials.
<%= will_paginate @my_object %>
and I only see the pagination links on the browser but I can't see the data, although when I try to loop through @my_object without using will_paginate I was able to get the data, I don't know what I am doing wrong I followed the same steps from this screencast.
@samani ismael
Hi, the method will_paginate doesn't display the data, only handles the paging.
<% for object in @my_object do %>
<%= object.id %>
<% end %>
<%= will_paginate @my_object %>
Is it here or the repository for will_paginate is down ?
How can we pass get parameters when user navigates to enother pages using will_paginate?
the repository seems to be down
http://require.errtheblog.com/ -> moving servers. be back soon.
:(
I'm assuming that there's no option for ASC/DESC ordering is there?
ie: :sort_order => 'ASC'
Whence comes transcendental logic, the solution of which involves the relation between the objects in space and time and our sense perceptions?
Hey Ryan, great screencasts. I've learnt 99% of my Rails from them :)
I have a question though...looking at my logs, it looks like the SQL generated uses 'like' everytime since the :conditions is used. Doesn't this take a very small performance hit?
What would be the best way to exclude the 'like' search except when a search term is passed? Use a condition to check if the 'search' parameter exists and then append it to the paginate code?
Thanks.
Keep up the great work.
Hi, Thanks for the very informative episode
Now we are facing problem with the new will_paginate in rails 2. Can you make a screencast for us on how to use it because we keep getting errors
Thanks
hey ryan! i'm trying this out today. it looks great in your tutorial! so hopefully it'll work for me.
noticed that the installer changed too, after the plugin just refused to get itself installed. please be advised :)
http://errtheblog.com/posts/56-im-paginating-again



