search for: paginate

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

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.
The built-in Rails pagination is fairly limited...you pass in the model name, and optionally some conditions, and it generates a paginated query for you. This gets to be very bad if you''ve got any custom queries. class Company < ActiveRecord::Base def complete_videos Video.find :all, :conditions => "company_id=#{id} AND status=''complete''", :order => "created_at DESC" en...
2006 Feb 07
11
breaking down a list view
...#39;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 calculates the total pages @placements = paginate :placements, # I am guessing that this calculates # pagination from total placements / # :per...
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...
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...
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
Hi, Why can''t I use a variable to specify the :per_page attribute when using the most basic form of pagination? (if I use a hardcode number, it runs) What did I do? Thx. My code: def list_orders page_size = 20 ... order_pages, @orders = paginate(:orders, :per_page => page_size) end My Errors: undefined method `>'' for false:FalseClass RAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace | Full Trace c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/ pagination.rb:210:in `<='...
2005 Dec 19
6
custom find methods and pagination
i''ve got several methods in my models i use to find based on certain criteria...i''ve done this so the controller code is less cluttered, plus the DRY factor. example: class Foo < ActiveRecord::Base def find_by_something(something) find :all, :joins => ..., :conditions => ... end def find_by_something_else(something_else) find :all, :joins => ...,
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 =...
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: ___________________________________________ ActionController::ActionControllerError in Data#list Unknown options: order /app/controllers/data_controller.rb:12:in `list'' /home/bclint...
2006 Jan 31
6
Pagination - why is it this hard?
...t it does, but to pass it a list of search conditions from the search action. So, if search determines that we need to get a list of all people in X department, it sets up searchconditions and tries to pass it to list. No luck there. My basic question is, what''s the best practice way to paginate over custom finds? The search results usually come up ok, it''s just that the pagination links don''t pass on the right parameters, so they either don''t work, or they just go back to the regular list, even though the action is search (in the URL). The most recent attempt...
2006 May 23
3
Pagination problem
...a... i hope this group will definetely help me to get rid of this simple problem.. my view and the listing method is given below... --------------------------------------- This is my controller/method --------------------------------------- def listtopics @public_topic_pages, @public_topics = paginate(:public_topics, :per_page=>2) @public_topics=PublicTopic.find_by_sql("select * from public_topics where category=''" + params[:id] + "''" ) end ----------------------------------------------- This is my view --------------- <%= error_messages_for ...
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
I''ve created a class method in my model called find_filtered. The intent is that I take various params that the user has submitted, and let the model build the query and return the AR collection, 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.n...
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 vi...
2006 Apr 13
7
Complex SQL in paginate command?
...associated images. So far I''m doing this by constructing a SQL query that goes something like this--an example using a maximum price: "select distinct h.* from houses h, images i where price < 1000000 and i.house_id = h.id order by price desc" I''m not sure how to paginate this query. Is it possible? Is there a simpler way to filter out all the houses without an associated image from a search? Thanks, Jeff Coleman -- Posted via http://www.ruby-forum.com/.
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-0...
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 like some sites
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 b...