Displaying 20 results from an estimated 4000 matches similar to: "NoMethodError"
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 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
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
2007 May 10
5
Pagination has many through problems
I have searched for days for an example that demonstrates what i would
like to do, and this morning i thought i''d worked it out, but
no....here''s what i have:
Controller
==========
class ProfilesController < ApplicationController
def friends
current_user.profile.friends
end
def list_friends
@profile_pages, @profiles = paginate( friends, :per_page => 10)
end
end
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 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 Nov 08
0
Paginating a fetched resultset problems with next/previous
Im using this paginate function to paginate complex sql queries
http://www.bigbold.com/snippets/posts/show/389, all seems to work fine
but theres one thing, when i hit the next link it show nothing, i mean
it only shows the first page, here is the code im using:
#application.rb-----------------
def paginate_collection(collection, options = {})
default_options = {:per_page => 10, :page
2006 May 01
12
pagination in acts_as_ferret
I''m just wondering where I would put the pagination for search results
when using "acts_as_ferret".
At the moment my search code is..
def search
@query = params[:query] || ''''
unless @query.blank?
@results = Tutorial.find_by_contents @query
end
end
Cheers
SchmakO
--
Posted via http://www.ruby-forum.com/.
2006 Jan 31
6
Pagination - why is it this hard?
Hi everyone,
I''m at the end of my rope on this. I can''t get pagination to work
with anything but a standard find on a model. If I try to do a search
and customize the pagination, I get lots of different variations.
My thought was to have the list action do what it does, but to pass it
a list of search conditions from the search action. So, if search
determines that we need
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
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
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 Aug 15
2
Working with user data
I am a Rails newbie and I am trying to build a test site in which users
will have their own sets of data.
I understand how to manipulate shared data very well. Most of the Rails
examples out there seem to deal with such shared data. I am struggling
with the "best practice" method for a user to work with their own data
however (and not be able to view/edit other users''
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 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 03
5
Strategy for persisting row filter variables in pagination?
I have my list view filtering rows shown within the table <tr> tags like
most of the introductory tutorials do. As I''m adding a few dozen entries
I''m noticing the standard scaffolding pagination doesn''t pick up the
number of rows from the filter since it is not being passed the number
of rows returned within the scope of the filter statement.
>From a
2006 Jun 08
3
MVC and Pagination
Just wondering how to best integrate with pagination and still stick to
MVC...
Say I have a Post model that has a published attribute. I want to show
all the recent published posts on a page.
My first instinct is to create a method in the Post model called recent
that does the find with proper conditions and order, but the problem I
have is how do I use that with pagination (which definitely
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 Jul 25
6
form and pagination question
Hello,
How do I get params from a form to use with a paginator?
debug(params) shows this
city: !map:HashWithIndifferentAccess
id: "1"
but in my controller, when I try to use
@hotel_pages = Paginator.new self, Hotel.count(:conditions =>
"hotels.city_id = params[:city][:id]"), 3, @params[''page'']
it doesn''t work. I suppose it''s a simple
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,