Group membership error that has me pulling my hair out.
I am getting this error:

2011-04-09T18:13:17+00:00 app[web.1]: NameError (uninitialized constant Group::Membership):
2011-04-09T18:13:17+00:00 app[web.1]:   app/controllers/groups_controller.rb:25:in `show_members'

When I try and use the Show_members method in the groups controller. What have I done wrong?


#user.rb
    class User < ActiveRecord::Base
      require 'paperclip'
      # Include default devise modules. Others available are:
      # :token_authenticatable, :confirmable, :lockable and :timeoutable
      devise :database_authenticatable, :registerable, :confirmable,
             :recoverable, :rememberable, :trackable, :validatable
      has_and_belongs_to_many :roles
      has_many :articles
      has_many :ratings
      has_many :rated_articles, :through => :ratings, :source => :articles
      has_many :memberships, :dependent => :destroy
      has_many :groups, :through => :memberships
      ...
#membership.rb
    class Membership < ActiveRecord::Base
      attr_accessible :user_id, :group_id
      belongs_to :user
      belongs_to :group
      validates_uniqueness_of :user_id, :message => "You can only join one group!"
    end
#group.rb
    class Group < ActiveRecord::Base
      require 'paperclip'
      attr_accessible :name, :group_admin, :about, :location, :created_at, :avatar
      validates_uniqueness_of :name, :group_admin
      validates_length_of :name, :in => 4..40
      has_many :memberships, :dependent => :destroy
      has_many :users, :through => :memberships
    end 
#group_controller
    def show_members # members page
        @group = Group.find(params[:id])
        @members = @group.users
        @group_admin = User.find(@group.group_admin)
        respond_to do |format|
          format.html
          format.xml  { render :xml => @group }
        end
      end
Group membership error that has me pulling my hair out.
===

I am getting this error:

2011-04-09T18:13:17+00:00 app[web.1]: NameError (uninitialized constant Group::Membership):
2011-04-09T18:13:17+00:00 app[web.1]:   app/controllers/groups_controller.rb:25:in `show_members'

When I try and use the Show_members method in the groups controller. What have I done wrong?


#user.rb
    class User < ActiveRecord::Base
      require 'paperclip'
      # Include default devise modules. Others available are:
      # :token_authenticatable, :confirmable, :lockable and :timeoutable
      devise :database_authenticatable, :registerable, :confirmable,
             :recoverable, :rememberable, :trackable, :validatable
      has_and_belongs_to_many :roles
      has_many :articles
      has_many :ratings
      has_many :rated_articles, :through => :ratings, :source => :articles
      has_many :memberships, :dependent => :destroy
      has_many :groups, :through => :memberships
      ...
#membership.rb
    class Membership < ActiveRecord::Base
      attr_accessible :user_id, :group_id
      belongs_to :user
      belongs_to :group
      validates_uniqueness_of :user_id, :message => "You can only join one group!"
    end
#group.rb
    class Group < ActiveRecord::Base
      require 'paperclip'
      attr_accessible :name, :group_admin, :about, :location, :created_at, :avatar
      validates_uniqueness_of :name, :group_admin
      validates_length_of :name, :in => 4..40
      has_many :memberships, :dependent => :destroy
      has_many :users, :through => :memberships
    end 
#group_controller
    def show_members # members page
        @group = Group.find(params[:id])
        @members = @group.users
        @group_admin = User.find(@group.group_admin)
        respond_to do |format|
          format.html
          format.xml  { render :xml => @group }
        end
      end