similar to: Paginate @member.items?

Displaying 20 results from an estimated 2000 matches similar to: "Paginate @member.items?"

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
2005 Nov 22
11
Building a conditions clause (for find) of multiple optional params?
I want to be able to find items according to various params - category_id, member_id, type_id, rating, etc. What I have now is something like: if(@params[''category_id'']) @items=Item.find(:all, :conditions=>["category_id=?", @params[''category_id'']) elsif(@params[''category_id''] and @params[''member_id''])
2006 May 14
3
Beginner question on paginate with params and conditions
I am trying to do a simple search by product name. The first page returns fine, but when I try to go to any other pages of the search results, I lose the original search parameters from my search form and get NilClass errors. Here is the code in my controller: namesearch = "%" + params[:name].strip + "%" @product_pages, @products = paginate :product,
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 Apr 16
11
Best way to sort categories w/ pager
Ahoy, I made this pager, " def list @item_pages = Paginator.new self, Item.count, 10, @params[''page''] @items = Item.find :all, :conditions => "category_id = #{params[:condition]}", :limit => @item_pages.items_per_page, :offset => @item_pages.current.offset @categories = Category.find_all
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 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 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,
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 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 Jan 28
8
how to pass search parameters to pagination links
I have a search page with a text_field as below <%= text_field ''program'', ''program_name'' %> After I perform the search in my controller I go to a search results view which shows search results and uses Rails pagination. Now how to pass the search paramters (i.e. params[:program][:program_name] in my controller) to the pagination links (next and
2006 Apr 07
2
Paginate single items
Hi, In my blog i display a post. I want to display a link tot he previous post if there is 1 and a link tot he next post if there is one. So i have in my controller def post @post = Post.find(params[:id]) @post_pages, @posts = paginate :posts, :per_page => 1 render(:layout => false) end And the following code in post.rhtml <% if @post_pages.current.next %> <%=
2006 Apr 27
2
How to override pagination_links method
I intend to override pagination_links method. I added following lines of code in application_helper.rb module ActionView module Helpers def pagination_links(paginator, options={}, html_options={}) raise("boom!!") end end end But my code is not executing my code. The view is still using the method pagination_links from rails. What''s the correct way to override
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 Jul 23
2
pagination_links and friendly urls
my pagination_links seems to auto generate the links using the current controller, action and id. The page they''re appearing on however have a friendly url I have created. I want to be able to make pagination urls generated by pagination_links "user friendly" as well so that they match my current naming convention.....i know there must be a way to do this....any ideas?
2006 Jul 12
2
Problem w/ Rails 1.1.4 and pagination_links using params?
I just installed version 1.1.4 and it seems like I started having problems with the pagination_links method. When I call the method using something like this (using the :params option--and this seems to be the problem), <%= pagination_links @todo_pages, :params => params %> then it duplicates part of the controller in the generated url. For example, before one of my paginator links
2006 Apr 27
5
def list - paginate question
How do I adapt this code to only list articles made by the user logged into the session? def list @article_pages, @article = paginate :articles, :per_page => 10 end -- Posted via http://www.ruby-forum.com/.
2006 Feb 17
2
validate uniqueness of two fields
I have Proposals and Members and Members can vote for a proposal only once. So, I have "Vote belongs_to :member, :proposal", but to make sure a member only votes once, I want to make sure that there isn''t a vote in the db with that member_id and proposal_id. I can just put the appropriate find in a vote.valid? but I wanted to make sure I wasn''t missing a nice rails
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 Jan 06
4
"Selecting" a calculated row / Using :select in the paginate method
Hi, I was trying to use the :select parameter to select a calculated row, but it appears that the parameter is not picked up by the paginate method. I want to add the following to the select statement: timediff(now(), created_on) as age So I tried: @story_pages, @stories = paginate :stories, {:per_page => 10, :include => ''user'', :select =>