search for: pagination

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

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 => "c...
2006 Feb 07
11
breaking down a list view
...e 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_page value :per_page => 10 # this one is obvious to me what I am interested in is changing the ''order'' of things...and probably having the most difficulty with the fact that I want the :order to be values of a...
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,
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
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...
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
...def show @user = User.find(params[:id]) @posts = @user.posts.paginate :per_page => 10, :page => params[:page] end [/code] How I do I go about using the post.list class method on the post object within the @posts variable (therefore DRYing up the pagination and leaving it in the model)? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsub...
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...
2006 May 23
3
Pagination problem
...ve 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 in all the pagination links.. It seems that pagination is not working.. whenever i click the pagination links,nothing change and the same page reload again with the same data... i hope this group will definetely help me to get rid of this simple problem.. my view and the listing method is given below... ----------...
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 Find" plugin. http://cardboardrocket.com/pages/paginating_find I''m using...
2006 Jul 31
1
Pagination of Complex Queries
...odel 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.nabble.com/Pagination-of-Complex-Queries-tf2030698.html#a5586011 Sent from t...
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 house...
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 bel...
2006 Aug 07
4
Problem with Pagination
...#39;'2006-07-12'', ''2006-08-12''], :per_page => 5, :order_by => ''e_date,name'') end However, if I change it to use the POST parameters in the conditions instead, the pagination fails. It correctly shows that I have 14 records and also shows that there are 3 pages, but when I click on "next page", it gives me an error saying that I have a nil when I didn''t expect it. def query @k2_result_pages, @k2_results = paginate (:k2_results,...
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 be paginated. My attempt to do this failed because