Ooops: forgot to add ".id" after "allowed_users[user]"
> 
> ...and here is my action
> 
>   def user_assigned_course(course_id, user_id)
>     allowed_users = Course.find_by_id(course_id).users
>     allowed_users.each do |user|
>       if allowed_users[user] == user_id
>         return true
>       end
>     end
>   end
> 
> ...help...

  def user_assigned_course(course_id, user_id)
    allowed_users = Course.find_by_id(course_id).users
    allowed_users.each do |user|
      if allowed_users[user].id == user_id
        return true
      end
    end
  end


-- 
Posted via http://www.ruby-forum.com/.