  In this paper using the connections between some subvarieties of residuated
lattices, we investigated some properties of the lattice of ideals in
commutative and unitary rings. We give new characterizations for commutative
rings $A$ in which $Id(A)$ is an MV-algebra, a Heyting algebra or a Boolean
algebra and we establish connections between these types of rings. We are very
interested in the finite case and we present summarizing statistics. We show
that the lattice of ideals in a finite commutative ring of the form $A=%
\mathbb{Z}_{k_{1}}\times \mathbb{Z}_{k_{2}}\times ...\times \mathbb{Z}%
_{k_{r}},$ where $k_{i}=p_{i}^{\alpha _{i}}$ and $p_{i}$ a prime number, for
all $i\in \{1,2,...,r\},$ \ is a Boolean algebra or an MV-algebra (which is not
Boolean).
  Using this result we generate the binary block codes associated to the
lattice of ideals in finite commutative rings and we present a new way to
generate all (up to an isomorphism) finite MV-algebras using rings.
