similar to: Pagination has many through problems

Displaying 20 results from an estimated 3000 matches similar to: "Pagination has many through problems"

2006 Jul 31
9
Multiple Pagination
I have the following: def index begin @restaurant_pages, @restaurants = paginate :restaurants, :order => (params[ :sort ] || "name"), :per_page => 2 @cuisines = Cuisine.find_all rescue redirect_to :action => :index end end # sort by cuisine def
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
2008 Jan 02
3
Submitted a patch, got pluses, what now?
Hello Rails people, I submitted a patch recently to get rid of an annoying exception raised when an AR object is created - http://dev.rubyonrails.org/ticket/10556 , had some people review it, got some pluses... What am I supposed to do now? Can anybody advise or just review the patch and take care of the issue? Thanks! -- Best regards, Yuri Leikind
2006 Apr 04
2
Pagination and Parent Conditions
Can I do any "fancy" conditionals when using the Pagination helper? The problem is that I want to be able to specify a conditional based on the criteria of a parent object. Here''s an example: Object A has_many Object B''s I want to paginate through 100 B''s but I *only* want it to return the ones who''s A.flag = true I poked around through the Wiki
2004 Jul 20
7
radiobuttons are weird in 1.2.x series
Hello all, Run groupbox.rb example in any of the two alpha versions and click the radiobutton in the upper right group box (those named Hilvesum 1, Hilversum 2, etc). You''ll notice that once a radiobutton is checked, it remains checked when some other radiobutton is checked. What''s the reason? Thank you. -- Best regards, Yuri Leikind
2006 Sep 25
1
ActiveRecord instead of direct sql execution
Hi all, I have 2 tables and a standard one-to-many association. How do I substitute the following sql with ActiveRecord calls so that it uses just one sql statement: update geo_entities set terminal_id = 3 where id = 10 or id = 23 or id = 87; Thank you! Regards, Yuri Leikind --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to
2006 Feb 23
6
Search Forms with Pagination
Hi there everyone, I''ve recently moved to RoR and am still struggling with the basics of what used to be second nature in php, so on with my question: I have a database with products, and I need to create a search form that paginates the results. What I have so far in my controller is: def list # If the values are nil, then set them, otherwise wrap them in % # Also,
2006 Mar 18
3
paginate a collection
hi i want to paginate a collection found by complex sql query how can i do thanks -- 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
2008 May 08
1
Eager loading of association extensions
Hello all, Is it possible to do eager loading of association extensions? That is, the following code produces one SQL query: cat = ProductCategory.find(:first, :include => :pricing_rules) cat.pricing_rules But if in ProductCategory I have an association extension like this: has_many :pricing_rules do def applicable() find(:all).select(&:applicable?) end end the
2007 Dec 10
4
Need help in Ajax Pagination
hi All, i wants to implement ajax pagination but i am facing a lot of problem , i found i lots of links on google but their is no explanation like what object we have to pass and condition can any body help me out in this concern pls i need your help as soon as possible thanks sachin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the
2007 May 10
2
Dynamic counter?
Hi, In a form I have a text area T and a disable text field C (for counter). C must show dynamically how many characters have been typed in T. Should I go in for a Javascript solution (or Ajax) or is there any other way? Thanks, Ram. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are
2007 Oct 15
3
NoMethodError
Hi to all!! I am new to ruby. I am trying to write a program to fetch the data from Database and written the data using pagination. I could get the data from DB. but pagination is not working. When i see the log file it is showing the following error. NoMethodError: undefined method ''paginatior'' #<Hash...> my pginate.rb and pagination.rb files are not in the same folder
2007 May 20
2
Newbie question - self.var OR @var in ActiveRecord
I started learning rails by following the agile way. It comes to the point where it puzzles me. class Puzzle < ActiveRecord::Base # virtual var, not existing in the database def var @var end def var=(foo) @var= foo @var_in_database = @var + 1 # var_in_database exists in database end end Then when I do a save of this model it does nothing. I know that if I instead put
2009 Oct 05
11
Unable to install plugins from github
Hi All, My operating system is FC11...I tried to install will_paginate from github directly like this - script/plugin install git://github.com/mislav/will_paginate.git But I get an error saying [ckkashyap@KingCobra test_plugin]$ script/plugin install git://github.com/mislav/will_paginate.git Plugin not found: ["git://github.com/mislav/will_paginate.git"] I have git on my machine - I
2006 Mar 31
6
Adding objects to a :through association
So I''m one of those nasty people building a self-referential habtm-like Association using the funky new :through stuff. This is about users having friends, so here''s my user.rb: class User < ActiveRecord::Base has_many :friendships, :foreign_key => ''user_id'' has_many :friends, :through => :friendships, :source => :friend end And here''s
2006 May 28
7
Self-referential has_many :through relationship
Hi, I have a self-referential has_many :through relationship setup to track relationships between users. Basically relationships are modeled as a join table with an extra column ''relation''. create table relationships ( user_id integer unsigned not null, friend_id integer unsigned not null, relation char(1) not null, ) --- relations --- f = friend r = request to
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 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 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,