search for: paginator

Displaying 20 results from an estimated 674 matches for "paginator".

2006 Mar 31
4
Question about pagination
Hi! I''ve got a list of project on the main page and if one of them is selected i render a partial using ajax with data of selected project. How to create links to next/previous project using pagination? -- Posted via http://www.ruby-forum.com/.
2007 Apr 04
2
[PLUGIN] ArPaginator - Allows you to easily paginate over any existing AR queries.
...ND status=''complete''", :order => "created_at DESC" that''s obviously not DRY. You''ll have to update your paginate call if the logic of complete_videos changes, and on top of that you''re putting busines logic in the controller anyway. ArPaginator solves this problem by letting you paginate over any query. Using it, the new pagination code would be paginator = ArPaginator.new(:model => :video, :controller => :videos) @video_pages, @videos = paginator.paginate(:page => params[:page]) { @company.complete_videos } Now you can take an...
2006 Feb 07
11
breaking down a list view
I''m trying to figure out how to change the order of a list view and it''s obvious to me that I don''t understand what I get from a simple scaffold to know enough to alter it. If someone would be so kind to tell me what this means ... def list @placment_pages, @placements = paginate :placements, :per_page => 10 end @placement_pages, # I am guessing that this
2006 Jul 16
3
pagination over custom-sorted collections?
I have a little web app where we need to paginate collections of items. I''m trying to sort the collection and then pass it, sorted, to a Paginator, and still be able to paginate through the collection, across several pages, with the new sort order. The only thing I''m doing differently from the regular scaffolding approach is this: @order_pages = Paginator.new(self, @orders.length, 10, (params[:page] ||= 1).to_i) It doesn''t...
2006 Jun 21
7
acts_as_taggable and paginate?
Hi there, I''ve been trying to paginate over a list of members that all share a tag in common using the acts_as_taggable plugin. The regular way of paginating over a collection doesn''t seem to work with acts_as_taggable. Here''s what my method looks like that takes in a tag name, finds all the members that share the tag and then displays all the members. Nothing too fancy
2005 Dec 16
13
How to pass a collection to paginate?
There must be a better way to write this code: @project_pages, @projects= paginate :project, :per_page => 10, :conditions => ["account_id = ?", account] ?! If only I could pass the sub-collection account = ... @projects = account.project to paginate, instead of letting it extract it with a find :all + sql conditions Alain. -- Posted via
2006 Feb 13
1
another simple question: per_page in pagination
...s/1.8/gems/actionpack-1.11.2/lib/action_controller/ pagination.rb:210:in `initialize'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/ pagination.rb:191:in `new'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/ pagination.rb:191:in `paginator_and_collection_for'' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/ pagination.rb:124:in `paginate'' #{RAILS_ROOT}/app/controllers/book_viewer_controller.rb:77:in `list_orders'' - RoR newbie - -- Posted with http://DevLists.com. Sign up and s...
2005 Dec 19
6
custom find methods and pagination
...end def find_by_something_else(something_else) find :all, :joins => ..., :conditions => ... end def find_by_something_and_bar(something, bar) find :all, :joins => ..., :conditions => ... end now my question: is there a way to do Foo.find_by_something(something) in a paginator? would I have to modify all my methods to accept a limit and offset parameter? thanks _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
2008 Feb 29
7
Moving pagination to the Model
I''m using will_paginate in a Post class method; [code]def self.list(page) paginate :per_page => 10, :page => page, :include => :user end[/code] I can happily use the method on my posts controller index action; [code] class PostsController < ApplicationController def index @posts = Post.list(params[:page]) respond_to do |format|
2006 May 23
5
Wierd pagination problem - Unknown options: order?
I am trying to use pagination with the order option. I am following examples I''ve seen all over the web, but I am getting an error. My code seems simple: def list @upload_pages, @uploads = paginate :uploads, :per_page => 20, :order => ''id'' end Yet I keep getting this error: ___________________________________________
2006 Jan 31
6
Pagination - why is it this hard?
Hi everyone, I''m at the end of my rope on this. I can''t get pagination to work with anything but a standard find on a model. If I try to do a search and customize the pagination, I get lots of different variations. My thought was to have the list action do what it does, but to pass it a list of search conditions from the search action. So, if search determines that we need
2006 May 23
3
Pagination problem
hi everybody, i am new to rails.. plz clear my doubt... this is my question In my table(public_topics), i have 11 rows of data.. whenever i run the following view, it shows the entire rows in the current page.. and i have set the '':per_page'' option to ''2''.so it must show two data per page..but it shows all the rows in a single page..and this case continue
2007 Feb 10
2
Ferret and Paginating Find
Hey all, I''ve been really happy with ferret thus far and all my search on my site is based on it. One of the recent challenges I ran into is changing some of my pagination within my site. Until now, I just used the tutorials out there that talk about how to get pagination working with acts_as_ferret. Recently, I decided to change my pagination to begin using the "Paginating
2006 Jul 31
1
Pagination of Complex Queries
...tion, which is exactly what happens. However, now I''d like to paginate the recordset. Everything I''ve been able to find about pagination presumes that you have no pre-existing AR collection. Is there a way to use the result of my find_filtered (which is an array of AR) and create paginator objects for it? Thanks -- View this message in context: http://www.nabble.com/Pagination-of-Complex-Queries-tf2030698.html#a5586011 Sent from the RubyOnRails Users forum at Nabble.com.
2006 Apr 18
1
Pagination links with separator
Hi, I have @result_pages and @results obtained from paginate in an action. I want to show the pages as 1 | 2 | 3 | 4 > The fifth page will show: < 5 | 6 | 7 | 8 > and so on. How exactly do I render the paginator to give this effect? I guess I will have to use pagination_links_each. But being new to Rails, I need help. Thanks, Yash -- Posted via http://www.ruby-forum.com/.
2006 Apr 13
7
Complex SQL in paginate command?
Hi all, Is there a way to create pagination with a complex SQL, more complex than the :conditions option will support? I have two databases, houses and images. Houses has_many images, and each Image belongs_to house. I''m creating a search engine for the house records and I''d like to be able to filter out all the houses without any associated images. So far I''m
2009 Aug 18
4
pagination problem....
Hi, please help... In controller... def index @customers = Customer.find(:all) pagination code here.... end In index.html.erb Displayes list of customers and has pagination 1,2,3,4...etc. On clicking page 2, it will again run this(Customer.find(:all)) query in controller. So, there will be lack of performance. So, how to increase the mysql performace? Can i use the index as below or any
2006 Aug 07
4
Problem with Pagination
Hi Guys, I am trying to paginate the results from a search. When I use actual constants in the search conditions, it works fine: def query @k2_result_pages, @k2_results = paginate (:k2_results, :conditions => [''e_date >= ? AND e_date <= ?'', ''2006-07-12'', ''2006-08-12''],
2006 Apr 06
6
pagination question
i''ve figured out how to use the next and previous links with the paginator class but now i''m trying to figure out how to display all the page numbers in between. looking through the rails api, i found paginator.each() but i''m not sure how to use it, or if that''s even what i am looking for. also, is there a way to limit the amount of pages li...
2006 Feb 16
1
Pagination help/how to
Hello, I want to know how can I paginate a set of records. It seems there is no direct way of doing this, and I am not able to understand the documentation of paginate, so any pointers on how to do this will be much appreciated. To be specific what I want is that the records returned by user.recipes, the recipes of the particular user be paginated. My attempt to do this failed because