Displaying 1 result from an estimated 1 matches for "users_usertypes".
2006 Jan 16
1
[roles/users]I give up, please help
> Im testing ruby on rails and to practice i set my mind on making a login
> system. because i would come across of regularly made source.
> files:
user_controller.rb, user.rb
> my table layout:
users: |id|username|password
usertypes: |id|name| (admin, moderator, guest)
users_usertypes: |usertype_id|user_id| (+foreign key assocc)
> i have this in my user.rb file:
class User < ActiveRecord::Base
has_and_belongs_to_many :usertypes, :join_table =>"users_usertypes"
end
class Usertype < ActiveRecord::Base
has_and_belongs_to_many :users, :join_table =>&q...