similar to: Pagination - why is it this hard?

Displaying 20 results from an estimated 3000 matches similar to: "Pagination - why is it this hard?"

2006 Feb 15
10
STI Question
Hi everyone, I have 3 types of people (for now): Staff Faculty Students To break them up into classes, but keep them in the same People table, I''ve broken them up like so (code and ''ends'' snipped): class Person < ActiveRecord::Base class Employee < Person class Staff < Employee class Faculty < Employee class Student < Employee So, when I insert
2006 Jan 09
3
Pagination :conditions not working - MySQL v. PostgreSQL, Rails abstraction v. embedded SQL
Hi everyone, I have this code: @person_pages, @people = paginate :person, :per_page => 20, :conditions => [ "username LIKE ? OR first_name LIKE ? OR last_name LIKE ? OR preferred_name LIKE ?", "%" + params[:q].downcase + "%", "%" + params[:q].downcase + "%",
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/.
2006 Aug 01
3
paginate, search, sort with ajax problem
hello I hope somebody can help me figure this out. found this great tutorial at http://dev.nozav.org/rails_ajax_table.html. got it working except for one thing. I can''t seem to make the pagination work. The link_to_remote defined in the helper is pointing to the wrong url. I have set up things like so: defined a search method in de project_controller located in apps/admin/project.
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 Jul 22
3
How do you find out what action rendered a page
Hi I have this list page that has some rjs templates updating parts of it including a table of results. i''m trying to put pagination on the table. thing is lots of different actions update the table and they have their own paginators. anyway i have this code at the bottom which worked for another page <%= pagination_links_each(@offer_pages,:window_size =>4) do |n|
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 25
31
Ajax Scaffold Generator for Rails Released
I just released a whole new version of the Ajax Scaffold Generator (for Ruby on Rails). The generator creates a scaffold page like the typical rails one, except adding, editing and deleting are all done inline. The generated scaffold is valid XHTML strict and fully styled right out of the box. Check out the demo: http://ajaxscaffold.height1percent.com/ And the how-to:
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 Mar 21
2
Rails newbie can''t initialize a new Paginator object
Hi all, I''m using ruby 1.8.2-15 and a recent rails 1.0 download. I''m trying to implement the Classic/Custom pagination in a list action. Here''s my code: def list getSearchTerms # NOTE: @params[:search_results] is an Array of product_data objects # returned by a search action. @results = @params[:search_results] if @results.nil? then # The default
2012 May 22
4
undefined method `paginate'
I am working with Railsspace social networking book. I stuck in the problem when i am doing paginate for the search result. It gives the following error. NoMethodError in CommunityController#index undefined method `paginate'' for #<CommunityController:0x57436f0> My Controller Index page coding is below def index @title = "Community" @letters =
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 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 ? )
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 Jan 04
8
Trying to display data from two tables
Alrighty folks, I''m really trying here, and want to succeed with Ruby on Rails. I''m trying to display data that is linked from two tables using the Active Record naming conventions, as described in Agile Web book. The stripped-down basics; Database drop table if exists people; CREATE TABLE `people` ( `id` int(6) NOT NULL auto_increment, `lastname` varchar(30) NOT NULL,
2006 Jan 30
0
Making sense of all the search options
Hi everyone, I have an app that manages accounts. There''s a search function that I don''t like, but it works: @person_pages, @people = paginate :person, :per_page => 20, :conditions => [ "LOWER(username) LIKE ? OR LOWER(first_name) LIKE ? OR LOWER(last_name) LIKE ? OR LOWER(preferred_name) LIKE ?", "%" + session[:q] +
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
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 Jun 07
3
Pagination
Does anyone know if there''s a plugin to do pagination numbers like: Prev 1 2 3 4 5 etc Next And automatically move through the pages? Thanks. -- Posted via http://www.ruby-forum.com/.
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 =>