Forum: Ruby on Rails trying to order a list view

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Craig W. (Guest)
on 2006-02-07 16:53
(Received via mailing list)
I'm trying to order a list view which contains elements from related
tables and wanting to use columns from the related tables to create the

The error...

NoMethodError in Placements#list
You have a nil object when you didn't expect it!
The error occured while evaluating nil.facility

The code...


  def list
    @client = Client.find(:all)
    @facility = Facility.find(:all)
    @placement_pages, @placements = paginate :placements, :order =>, :per_page => 14

If I remove the :order =>

I get the listing (unordered) with the column - no
problem. (facilies table is tied to placements table via foreign
keys/placements 'belongs_to :facility')

I want to be able to offer the list view ordered in different ways and
can't figure out the entry to do that.


This topic is locked and can not be replied to.