similar to: paginate :includes not working as I thought it should

Displaying 20 results from an estimated 30000 matches similar to: "paginate :includes not working as I thought it should"

2006 Apr 13
2
Dynamic finder conditions
Hi everyone, I''ve been working on some code which will take params and turn them into a WHERE clause for the :conditions option in finder methods. So far I''ve been able to do some very simple text matching. I''d like to be able to support ranges, and then go from there (in fact I''ve added code for date ranges but I''m embarrassed of it so I
2007 Sep 11
0
How to test ''Paginate''?
Great Hi to everyone: I don''t know how to write spec for a controller method which has ''paginate''. Is there any Rspec API for it? To illustrate, I would like to post an example. class PeopleController def paginate_method hash = Hash.new hash[:people_page], hash[:people] = paginate :people, ...#order and conditions omitted render
2006 Apr 05
1
Problem with paginate and conditions
Hi! I have a search form that calls search action, which executes paginate method with many conditions using data from the form. Now if all results don''t fit into a single page, do i have to send all conditions again to paginate method in link_to previous/next? If yes, how? All my parameters from the search form are inside a (nested) hash called ''form'' so i tried to
2006 May 26
0
Paginate include => :last and order by value
Why does it seem like I''m having so much trouble with this? I created a topics table, and a replies table. In my Topic model I used the following lines of code: has_many :replies has_one :first_reply, :class_name => ''Reply'', :order => "created_on" has_one :last_reply, :class_name => ''Reply'', :order => "created_on DESC"
2006 Feb 28
5
Problem with paginate, include and foreign keys
Hi all, Solaris 10 Ruby 1.8.4 Rails 1.0.0 Postgres 8.1 postgres driver 0.7.1 I''m having a problem with getting paginate() to properly pick up an FK constraint properly. I don''t seem to have this issue with ActiveRecord, however. Consider: create table start_dates ( id bigserial, start_date date unique, max_slots int default 40, primary key (id) ); create
2006 Jan 10
0
Paginate with two tables ?
First I read previous thread with similar problem but I don''t find answer (problem is little diffrent) Hello, I have problem with display information from two tables using paginate.. Here is code. ##### SQL create table subscribers ( id integer not null auto_increment, name varchar(32) not null, surname varchar(64) not null, create_timestamp DATETIME not null, modify_timestamp DATETIME
2006 May 25
16
yet another rails site - happycarpools.com
I''m pretty much done with a project I''ve been developing to learn Rails, http://www.happycarpools.com . If you could take a look, that''d be awesome! Feedback would be even more awesome! Probably the coolest thing about making this has been seeing how Rails does *so much* and hardly has any superfluous parts, if any. There are so many features that I initially
2008 Mar 31
10
Paginate with Rails 2.0.2 question
Hi, So I''m using @post_pages, @posts = paginate :posts, :per_page => 10 to paginate. But I have rails 2.0.2 on my VPS. Now this version of paginate throws an error. What happened to classic pagination and what is done now? Thanks, Ron --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on
2006 Apr 12
1
how do i paginate the results of a query?
I have a controller and list page for region object. My list page has a ''name'' text input that can be used to limit the list. It works except that the paginate gets the full set of regions unqualified by my search term. I believe this full list is contained in :regions symbol which I dont seem to be allowed to modify or replace (yes I am a ruby and rails newb). How can I
2006 May 22
4
use join table in paginate
How come I allways immediately run into difficult stuff when I''m trying some new programming language? Am I blind for the simplicity of Ruby/Rail, which a see must be there? Anyway, don''t try and answer this rhetoric question. I have got another one for you, seemingly difficult. I''m struggling with a n:m relationship (in a database, that is) and its join table.
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
2006 Feb 13
1
Paginate @member.items?
Is there a quick and easy way to paginate something like @member.items (Member with has_many :items)? Right now I do in the controller: @item_pages, @member_items = paginate :item, :conditions=>["member_id=?", @member.id], :per_page=>25, :order=>''datetime desc'' It''d be more DRY if this was possible: @item_pages, @member_items = paginate
2006 Nov 04
0
How to paginate a find_by_sql query?
Does anybody know how to paginate a find_by_sql query? Unfortunately I need to paginate a query which is next to impossible for ActiveRecord or just too much of a pain to implement. So I''m using find_by_sql. However, I anticipate a large number of rows returned eventually. So I may need paginate. Does anyone know how? Thanks Phillip Novess http://primalart.net
2006 Jun 11
0
mySQL paginate syntax question for complex SQL. (over 117 views in rubyonrailsforum and no answer, others confused..)
I have this code in my controller and i cannot seem to figure out how to get it to paginate correctly.. Is there a trick to do something like this? There are a few others at www.rubyonrailsforum.com that are having the same issue. Any incite would be great, thanks in advance! (over 117 views and no answer in rubyonrailsforum???) def display_location if params[:search] &&
2006 Dec 18
2
Find, paginate, conditions and associations
Hi, I''m trying to figure out how to use paginate when one of the conditions depends on the association between one model and another. For example: I have a model Authors which has_many Posts. I would like to find all the authors and order them by the number of posts that they have published and then paginate those results. What if I wanted to base the paginate condition on all the
2006 Jul 23
2
how to paginate child records
hi i know i can do: @customer_pages, @customers = paginate :customers, :per_page => 8 but these customers have helpdesk calls which are child records. I hoped i could do something like paginate customers.calls, but dat doesn''t work what is the best way to get a paginated list of child records? remco -- Posted via http://www.ruby-forum.com/.
2006 Jan 06
2
Paginate from a difficult sql query
Hello, I have 2 tables table colors : +----------------------+ | id | user_id | name | +----------------------+ | 1 | 1 | test1 | | 2 | 2 | test2 | | 3 | 3 | test3 | +----------------------+ table users : +----------------------+ | id | enabled | name | +----------------------+ | 1 | 1 | bob | | 2 | 1
2005 Sep 21
0
:select option with paginate / count
The head of the tree supports the :select option for find which allows one to override the default select(*) behavior of find. In my case, this allows me to throw in a DISTINCT call to ensure the results are of course distinct. Paginate supports :select since it passes it right through to find. However, count does not support it. This causes the paginator to think it has more entries to
2006 Mar 01
2
Problem with paginate search
Hi, Firts all sorry for my poor english I am doing a simple search with paginate, the problem is the search dont find the words within acutes (example "dont find sal?n if i search salon"). Its the code for the seach: def search words = @params[''search''].to_s.split('' '') array_conditions = [] for w in words array_conditions =
2006 Jun 10
1
paginate session problem.. (syntax question)
I have this code in my controller and i cannot seem to figure out how to get it to paginate correctly.. Is there a trick to do something like this? There are a few others at www.rubyonrailsforum.com that are having the same issue. Any insite would be great, thanks in advance! def display_location if params[:search] && params[:search].size > 0 @listing_pages, @listings =