Displaying 1 result from an estimated 1 matches for "gettem".
Did you mean:
getter
2006 Jan 16
1
[roles/users]I give up, please help
..._belongs_to_many :usertypes, :join_table =>"users_usertypes"
end
class Usertype < ActiveRecord::Base
has_and_belongs_to_many :users, :join_table =>"users_usertypes"
end
> in the user_controller (or application controller) are methods like this
> (sadly i cant gettem to work)
> # this method should verify if the active user has an ''admin'' usertype
> # connected to it
def auth_by_type(type)
@user = User.find(@session[:user_id]) #this searches for current user
if @user.usertype == type
flash[:notice] = "You are authorized...