Allowing users to subscribe to categories
When you load the user, you can include the categories using eager loading. 

@user = User.includes(:categories).find(params[:id])


or 

@user = User.find(params[:id])
@categories = @user.categories.all