In this paper, we use multivariate polynomial rings to construct quantum error-correcting codes (QECCs) via Hermitian construction. We establish a relation between linear codes and ideals of multivariate polynomial rings. We give a necessary and suffcient condition for a multivariate polynomial to generate a Hermitian dual-containing code. By comparing with the literatures in recent years, we construct 31 new QECCs over Fq\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathbb {F}_q$$\end{document}, where q=3,4,5,7\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$q=3,4,5,7$$\end{document}. Some of them reach quantum singleton bound and some of them exceed quantum GV bound.