Really no idea what's up...
class Auction < ActiveRecord::Base
has_and_belongs_to_many :categories
end
class Category < ActiveRecord::Base
has_and_belongs_to_many :auctions
default_scope order('title')
scope :active, where(:active => true)
end
class CategoriesController < ApplicationController
respond_to :html, :json
# GET /categories/:id
def show
@category = Category.where(:id =>
params[:id]).include(:auctions).first
respond_with(@category)
end
end
I receive the error:
undefined method `include' for []:ActiveRecord::Relation
I have tried this on simple has_many relationships as well, and I get
nothing but this error when trying to use .include
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.