similar to: Re: Wierd pagination problem - Unknown options:

Displaying 20 results from an estimated 1000 matches similar to: "Re: Wierd pagination problem - Unknown options:"

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 May 23
3
Pagination problem
hi everybody, i am new to rails.. plz clear my doubt... this is my question In my table(public_topics), i have 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
2006 Feb 08
7
DRY methodology
because I am a grasshopper... Now that I can sort my ''list''...is there a logical way of not repeating myself to having essentially the same list view with multiple sorts? i.e. def list_cl # ordered by clients last name @placement_pages, @placements = paginate( :placements, :include => [:client], :order_by =>
2006 Jun 14
4
Using now() to determine what should be displayed
I''m trying to create a paginated list that will take note of the "end_date" field in my table. This is what I have: @post_pages, @posts = paginate(:posts, :per_page => 10, :order_by => ''end_date'') in the controller. And for the view: <h1>Posts ending soon</h1> <ul><% for post in @posts do %> <strong>Post Title:
2006 May 14
4
searching on foreing keys
Hey all, I''m using a simple search function. It''s working great except for foreign keys. I have one table pets (id,name,owner_id) and another table people(id,name) owner_id being a foreign key of pet pointing to people name. here it is on the pet controller: @paginator, @pets= paginate(:pets, :conditions =>["name OR owner_id like
2006 Apr 10
9
Pagination with letter (A B C D ... Z)
Hi there, Is there a neat and easy way to implement pagination with letters rather than numbers eg : A B C D ... Z Rob
2006 Feb 07
11
breaking down a list view
I''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
2006 Jan 02
6
Paginate with joins messing with id
Hi all, Best wishes for the new year! :'') I''m very new to Ruby and Rails, and I ran into a problem with the "paginate" function. When I use the following method to get a number of forum topics based on a category name passed via the URI: @topic_pages, @topics = paginate :topics, :joins => "INNER JOIN categories ON
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 Aug 17
8
Creating queries..
Hi, I am trying to implement a few queries now. What are good ways to do this? Right now, I have a list page that does sorting and can carry out a generic pagination request. @user_result_pages, @user_results = paginate(:user_results, :per_page => 20, :conditions => @condition, :order_by => @sort_order) I create @sort_order earlier in the list function. The problem I am having is
2006 Jun 08
9
find :order =>
Hi, I have the following find statment @client_pages, @clients = paginate :clients, :per_page => 20, :order => "organisation_id, surname" currently im ordering by organisation_id however I need to order by the field in the organisation table organisations.name how can this be done? Thanks Scott -- Posted via http://www.ruby-forum.com/.
2006 Feb 18
1
sql logic is killing me
I know my thinking is sloppy. I want to know how many clients currently in my facility are male... My facilities_controller.rb def list_fac @placement_pages, @placements = paginate( :placements, :conditions => ["placements.facility_id = ?", params[:facility_id] ], :include => [:facility, :client], :order_by => ''facilities.name,
2006 Jun 13
2
four days on rails - nil object when you didnt expect it
Hi all, Im trying to get my head around rails and to help along Im working through "four days on rails" as this seems to give a good real world example with multiple tables and relationships (the main thing I cant work out!) Ive got stuck. Some help would be really good here. The controller has this code: def list @category_pages, @categories = paginate(:category, :per_page =>
2005 Dec 31
3
Sort or Order a <Select> box.
Evening folks, I''m new to RoR, and have found some very useful info on this site, thanks. I have a select box that I need to sort. <select name="people[peoplekind_id]"> <% @peoplekinds.each do |peoplekind| %> <option value="<%= peoplekind.id %>" <%= '' selected'' if peoplekind.id == @people.peoplekind_id %>> <%=
2006 Apr 16
7
table sorting
Ahoy, I checked the API and did some forum searches but didn''t find anything good on table sorting. Is there a "railish" way to do this? My current method really is lacking (i''m on like rails day 2) <th><%= link_to ''Name'', :action => ''list'', :order => ''name'' %></th>
2006 Jan 19
8
Pagination_links without "?page=" but with params[:id]
Hello, With default pagination I have this : <a href="/users/infos/3?page=1">1</a> <a href="/users/infos/3?page=3">3</a> but i need this : <a href="/users/infos/1">1</a> <a href="/users/infos/3">3</a> I need to remove the "?page=" parameters and rewrite a little the link ( with a link_to ? )
2006 Feb 19
8
building multiple find conditions
I am trying to allow for AND type ''find'' but to allow for simply a single set of find criteria. controller code... @vw_string = @vw_string1 = @vw_string2 = @vw_string3 = [] if params[:beg_intake_date] != "" then @vw_string1 = ["intake_date between ? and ?", params[:beg_intake_date], params[:end_intake_date] ] end if
2006 Aug 03
2
pagination with customer list.rhtml
(To preface this - you can just imagine I am making the cookbook from the Rolling with Ruby on Rails tutorial) I have made a customer list view (list.rhtml), so that I could include attributes from multiple database tables. This works fine, however, the list page no longer paginates (i.e. does limit the item list to 10 items at a time, with a 1, 2, 3... links at the bottom) I am trying to
2006 Aug 14
5
Tutorial for Queries
Hi! I''m looking for a good tutorial that explains the main points of performing queries with Rails. I do have AWDWR and have read the section on ''find'' but I''m looking for something that goes into more detail on how to perform queries across tables. Abstracted from my current application, this is an example: * person has_many sites * site has_one room *