added generate_slug method for posts, users, categories