I have seen the following definition: If $R$ is a subring of $R'$ and $a\in R'$. Then $$ R[a] = \{f(a): f\in R[x]\}. $$ This explains well what, for examle, $\mathbb{Z}[i]$ and $\mathbb{Q}[\sqrt{2}]$ are.
My question is how one defines things like $\mathbb{Z}_n[i]$. Here $i\in \mathbb{C}$. The problem is that $\mathbb{Z}_n$ (in the definitions that I have seen) is not a subring of $\mathbb{C}$, so the above definition doesn't work. I get how to actually work with these rings, so I am just asking about the precise definition.
EDIT: I see (with the current answer and with this) that one can do this with quotient rings. I guess my question is if there is a more fundamental way of defining it.
There are two definitions that people use for rings of this form:
Notice that when $\alpha$ is transcendental, the kernel of the map is empty and so we get back $R[x]$ as desired. When $\alpha$ is not transcendental, taking this quotient basically enforces a new rule on $x$, namely that it satisfies $\phi_\alpha(x)=0$. This ensures that $x$ satisfies the necessary algebraic properties to “really be $\alpha$.”
The first definition gives a construction of precise the object that satisfies the second definition. Both of these definitions also work for $F(\alpha)$ and $F[\alpha]$ with minor modifications.