Displaying 20 results from an estimated 5000 matches similar to: "Styling pagination links ?"
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 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
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 Jan 26
21
pagination_links help
I want append custom query parameters to my pagination links, like
?page=1&foo=bar. I can''t quite figure out how to do this with the
pagination_links helper, although I believe the API says you should be
able to:
pagination_links(paginator, options={}, html_options={})
options are:
:params: any additional routing parameters for page URLs
Has anyone tried this?
thanks,
jeff
--
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 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 Apr 06
1
Rendering partials with pagination
I currently have a call to this action, which I''d like to paginate:
def get_words
@catid = params[:category]
@words = Category.find(@catid).words
render :partial => "word_display", :collection => @words
end
As you can see, a word_display partial is rendered for each word.
If I add the pagination call (getting the links object), how can I then
get
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
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 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 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 31
1
Pagination of Complex Queries
I''ve created a class method in my model called find_filtered. The intent is
that I take various params that the user has submitted, and let the model
build the query and return the AR collection, which is exactly what happens.
However, now I''d like to paginate the recordset. Everything I''ve been able
to find about pagination presumes that you have no pre-existing AR
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,
2005 Nov 02
1
getting pagination to work on joined tables
As soon as I use Model.find(:all, :include => [...], :limit => 3) I
loose associations and can''t do :conditions on joined tables. I''m not
able to do pagination in such association.
Only solution I came up with is this beast:
# I set up a paginator:
@reos_pages = Paginator.new self,
Reo.count(conds.join('' AND ''),
2008 Mar 06
1
pagination for an object array
def show_details
@sd_ticket = ServiceDeskTicket.find(params[:id])
@servicedesk_cis = @sd_ticket.service_desk_cis
end
What I need is a pagination for @servicedesk_cis using the custom
pagination..How can i give offset and limit to this?
I have successfully done previously custom pagination in another def as
below
def search_sd_ticket
@search_sd_ui_hash=params[:sd_ticket]
2005 Dec 19
2
Advanced search/filter use cases
I''ve been working on an application lately that has a lot of advanced
search and filtering functionality (with ranges and substring searches
for each attribute). Despite being a pretty common use case, this isn''t
supported particularly well by any framework I''ve used, including Rails.
I''d like to fix that. :)
Right now, my major pet peeves are:
1. Long,
2005 Aug 04
1
Pagination and :include (eager associations)
I have tried to use eager association with pagination, but
the :include option is not supported:
Here''s the one-line pagination call without :include
@link_pages, @links = paginate :link, :per_page => 10, :order_by
=> sort_clause
and here the work around, using the "classic" method
# @link_pages = Paginator.new self, Link.count, 10,
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