  The ground-state magnetic structures of the Eu$^{2+}$ spins in recently
discovered RbEu(Fe$_{1-x}$Ni$_{x}$)$_{4}$As$_{4}$ superconductors have been
investigated by neutron powder diffraction measurements. It is found that as
the superconductivity gets suppressed with the increase of Ni doping, the
magnetic propagation vector of the Eu sublattice diminishes, corresponding to
the decrease of the rotation angle between the moments in neighboring Eu
layers. The ferromagnetic Eu layers are helically modulated along the
$\mathit{c}$ axis with an incommensurate magnetic propagation vector in both
the ferromagnetic superconductor RbEu(Fe$_{0.95}$Ni$_{0.05}$)$_{4}$As$_{4}$ and
the superconducting ferromagnet RbEu(Fe$_{0.93}$Ni$_{0.07}$)$_{4}$As$_{4}$.
Such a helical structure transforms into a purely collinear ferromagnetic
structure for non-superconducting RbEu(Fe$_{0.91}$Ni$_{0.09}$)$_{4}$As$_{4}$,
with all the Eu$^{2+}$ spins lying along the tetragonal (1 1 0) direction. The
evolution from helical to collinear ferromagnetic order of the Eu$^{2+}$ spins
with increasing Ni doping is supported by first-principles calculations. The
variation of the rotation angle between adjacent Eu$^{2+}$ layers can be well
explained by considering the change of magnetic exchange couplings mediated by
the indirect Ruderman-Kittel-Kasuya-Yosida (RKKY) interaction.
