similar to: Can pagination work with caching

Displaying 20 results from an estimated 3000 matches similar to: "Can pagination work with caching"

2006 May 31
7
Getting 22 elements
Hello, I''ve done === class HomeController < ApplicationController def index @country = Country.find(:all, :include => "cities") end end === And rhtml is: === <% @country.each do |country| %> <h1><%= country.name %></h1> <% country.cities.each do |city| %> - <%= link_to city.name, :action =>
2006 Apr 23
3
ANN: Polygons library + sweet demo
Hello! I''m releasing an extraction from an application I''m currently working on. It''s a small library for dealing with points and polygons, called Polygons. It really just implements some textbook algorithms w/ Prototype-style JavaScript classes. Check it out here: http://polygons.mdaines.com/ The demo on that page (Firefox/Safari only right now) uses the
2006 Apr 19
4
Another DRY question
I have some code working that lists only items from a particular user. The code in my list action finds the user and then conditionally lists only his/her items: def list user = User.find(session[:user]) user_id = user.id @product_pages, @products = paginate :products, :per_page => 10, :conditions =>[''user_id = ?'', user.id]
2006 Jun 06
1
Default value plugin
I''m releasing a very small plugin that allows you to specify default values for fields in models. Ordinarily, you might do this in your schema, I guess, but then it''s awkward if you need that on a serialized field or need your default values calculated somehow. So you can do something like this: (repeated from an earlier post and the README) class Mixture <
2006 Jun 02
6
Set instance variable for all actions in the Controller
Can I set an application wide instance variable that is available for all actions...and their views? eg. class ApplicationController < ActionController::Base @current_user = User.find(session[:user_id]) end and everywhere I can call @current_user.id and I can get that object? Even down in the views? I could not get this to work... Thanks in advance, Jeff -------------- next part
2006 May 03
4
default values
Hello, I''m working with a postgresql table CREATE TABLE elements ( id serial primary key, c1 text default f1(), ... cN text default fN() ); But if I use de lines @element = Element.new @element.save the values that element take are the nextval in the id field and nules in all the other fields. How can I get the defaults? (but without rewriting the
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
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 Feb 01
1
Rails pagination problem
I am having this problem with pagination query in my controller class. I am using SQL server and following code to create pagination fails, complains about column name ''program_name'' (which is valid column/attribute of program) The error message is: DBI::DatabaseError: S0022 (207) [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name
2006 May 22
6
which kind of deployment has the best performance
In the following deployment of web app on ONE pc-based server,running linux,which can support the most amount of concurrent users as well as the shortest latency? 1 apache+mongrel 2 apache+mongrel_cluster 3 lighthttpd+mongrel 4 lighthttpd+mongrel_cluster 5 lighthttpd+fastcgi Thanks charlie -- Posted via http://www.ruby-forum.com/.
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 24
1
Pagination
Hello, maybe that I''m a stupid, but I don''t know how I can working with pagination. In all examples is written (for example) next: def user_list @user_pages, @users = paginate(:users, :order_by => ''name'') end So, it''s OK (as a scaffold) for all set of users. But I need a little other functionality. For example I need paginate only a little bit
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:
2006 Mar 13
1
Pagination & Feedtools
Is it possible to paginate rss feeds with FeedTools. The following code generates an error about constants. latest_feeds = FeedTools::Feed.open(''http://feeds.feedburner.com/Eribium'') @news_pages, @pages = paginate :latest_feeds, :per_page => 5 -- Posted via http://www.ruby-forum.com/.
2006 May 23
1
Re: Wierd pagination problem - Unknown options:
> Unfortunately I still get the same error. Here is my code now (the > commented line works): > > def list > @upload_pages, @uploads = paginate(:uploads, :per_page => > 20, :order > => ''id'') > # @upload_pages, @uploads = paginate(:uploads, :per_page => 20) > end You may have an older version, try using the order_by clause
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 Apr 06
1
Rendering partials with pagination
I currently have a call to this action, which I''d like to paginate: def get_words @catid = params[:category] @words = Category.find(@catid).words render :partial => "word_display", :collection => @words end As you can see, a word_display partial is rendered for each word. If I add the pagination call (getting the links object), how can I then get
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|
2009 Nov 03
2
will_paginate pagination problem
hi; i use will_paginate the first page come true but all other page get the same data of first page i checked in controller "page" parameter works true but paginate get only first page''s data and shows these data in all pages forexample first page seen A,B second page also seen A,B but second page must be C,D my code is; controller : @list = Company::Env.paginate :page =>
2005 Aug 17
2
CumulativeOffset
Hey All, I have a fairly basic question about the prototype.js library. First, I''ve been looking for documentation on this and I have yet to find it. If any of you know of any, please let me know. Since I''m new to both the scriptaculous and prototype libraries could someone explain why I would want to use the cumulativeOffset method and not to just grab the offset off