Ideal as a projective module
Solution 1:
Here are some partial results if you strengthen the hypotheses on the ring:
Definition: Let $R$ be a domain, $Q=\operatorname{Frac}(R)$. An ideal $I$ is invertible if there are elements $a_1,\dots,a_n\in I$ and $q_1,\dots,q_n \in Q$ such that $q_iI\subset R$ for all $i$, and $1=\sum_{i=1}^n q_ia_i$.
Theorem: If $R$ is a domain, then a nonzero ideal $I$ is projective iff it is invertible.
If we move from domains to UFD's, then:
Theorem: If $R$ is a UFD, then a nonzero ideal $I$ is projective iff it is principal.
A reference for the above theorems is Rotman's "An Introduction to Homological Algebra", 2nd. edition, pp. 167-168.
Solution 2:
For rings in general (with identity), the ring is called right hereditary if all right ideals are projective, and right semihereditary if all finitely generated right ideals are projective. There are a lot of other interesting equivalences and properties that these rings have, which you can find here.
A commutative hereditary domain is the same thing as a Dedekind domain, and a commutative semihereditary domain is the same thing as a Prüfer domain.
For examples that aren't domains (usually), semisimple rings are hereditary (on both sides) and von Neumann regular rings are semihereditary (on both sides).