You can do this with the universal properties of localization and of polynomial rings.
For $S$ a multiplicative set in the ring $R$, let's denote by $\lambda_{R,S}$ the map
$$
\lambda_{R,S}\colon R\to S^{-1}R,\qquad \lambda_{R,S}(r)=r/1
$$
For a ring $R$, let's denote by $j_R$ the embedding map
$$
j_R\colon R\to R[x]
$$
Universal property of localization. (UPL) If $S$ is a multiplicative set in $R$ and $\varphi\colon R\to A$ is a ring homomorphism so that, for each $s\in S$, $\varphi(s)$ is invertible in $A$, there exists a unique ring homomorphism $\varphi_S\colon S^{-1}R\to A$ such that
$$
\varphi_S\colon\lambda_{R,S}=\varphi
$$
This homomorphism is $\varphi_S(r/s)=\varphi(r)\varphi(s)^{-1}$.
Universal property of polynomial rings. (UPPR) For every ring homomorphism $\varphi\colon R\to A$ and every element $a\in A$, there exists a unique ring homomorphism $\varphi^a\colon R[x]\to A$ such that $\varphi^a\colon j_R=\varphi$ and $\varphi^a(x)=a$.
The homomorphism is $\varphi^a(r_0+r_1x+\dots+r_nx^n)=r_0+r_1a+\dots+r_na^n$.
With these properties we can first define a homomorphism
$$
\alpha\colon S^{-1}R\to S^{-1}(R[x])
$$
using the composition of $j_R$ followed by $\lambda_{R[x],S}$ and using UPL. Then we get $\alpha^x\colon(S^{-1}R)[x]\to S^{-1}(R[x])$.
We can also consider the homomorphism $(j_{S^{-1}R}\circ\lambda_{R,S})^x\colon R[x]\to (S^{-1}R)[x]$ given by the UPPL and then define
$$
\beta\colon S^{-1}(R[x])\to (S^{-1}R)[x]
$$
using the UPL.
Now it's just a matter of checking that the compositions $\alpha^x\circ\beta$ and $\beta\circ\alpha^x$ are the identities on the respective domains.
The above may sound complicated, but it's basically just a formal way of expressing that
$$
\frac{r_0}{s_0}+\frac{r_1}{s_1}x+\dots+\frac{r_n}{s_n}x^n=
\frac{r_0'+r_1'x+\dots+r_n'x^n}{s_1\dots s_n}
$$
(using a common denominator) and
$$
\frac{r_0+r_1x+\dots+r_nx^n}{s}=
\frac{r_0}{s}+\frac{r_1}{s}x+\dots+\frac{r_n}{s}x^n
$$