Are ideals in rings and lattices related? There are (at least) two notions of ideals:


*

*An ideal in a ring is a set closed under addition and multiplication by arbitrary element.

*An ideal in a lattice is a set closed under taking smaller elements and suprema.
They coincide nicely on Boolean algebras/rings.
Is there a common generalization of them, or can one of them be represented as a special case of the other?
 A: I believe that the notion of "ideal" for lattices came about later than the notion for rings, and that it originally arose in boolean algebras by analogy. It was later extended to lattices, and finally to partially ordered sets.
Kummer first introduced "ideal numbers" in his study of factorization in cyclotomic rings, $\mathbb{Z}[\zeta_p]$ where $\zeta_p$ is a primitive $p$th root of unity; some of these rings did not enjoy unique factorization, but Kummer used the notion of ideal number (with ideal being used in the sense of "existing in imagination or fancy only", and along the lines of an "imaginary embodiment of a quality"). These were "numbers" that did not actually exist in the rings, but which allowed for a kind of unique factorization (each element of $\mathbb{Z}[\zeta_p]$ could be written uniquely as a product of actual and ideal numbers). This was 1844.
Dedekind then took the notion of ideal number and replaced it with "ideal"; every "ideal number" of Kummer was identified with the set of all its "multiples", and this got extended to multiples of actual numbers. What we now call "principal ideals" corresponded to actual numbers, and nonprincipal ideals to ideal numbers. This allowed an extension from cyclotomic rings to arbitrary rings of integers in number fields. Dedekind gave several expositions of ideals, with the 1877 version probably being the most polished. You can find a very nice translation (with extended introductory remarks by John Stillwell) in Theory of Algebraic Integers by Richard Dedekind, Cambridge Mathematical Library , Cambridge University Press 1996, ISBN 0-521-56518-9. 
Dedekind defines an ideal of the ring $R$ (always commutative) as a non-empty set $I$ such that


*

*The sum and difference of any two numbers in $I$ are also in $I$; and

*Each product of a number in $I$ by a numbers in $R$ is a number in $I$.


These notions were later extended by Artin and Noether in the 1920s to more general rings.
According to Orrin Frink (in this 1954 paper in the American Mathematical Monthly), it was M.H. Stone who investigated the notion in Boolean algebras (The theory of representations for Boolean algebras by M.H. Stone, Trans. Amer. Math. Soc. 40 (1936), 37-111). A quick perusal of the paper (found in JSTOR) suggests that this was indeed the first time that they were treated as "abstract rings". 
This was then extended to other kinds of lattices. According to Frink, the definition of ideals in lattices proceeds by analogy to that of ideals in rings:

A collection $J$ of elements of a lattice $L$ is called an ideal if
  
  
*
  
*it contains all multiples $a\land x$ of any of its elements $a$; and
  
*it contains the lattice sum $a\lor b$ of any two of its elements.
  

(viewing $\land$ as multiplication and $\lor$ as sum). The point being that in addition to being analogous, in the case of boolean lattices the concept of "ideal" as a ring and "ideal" as a lattice coincide, as you note.
Frink then extended the definition to arbitrary partially ordered sets in the paper mentioned above. He writes:

The first problem here is to discover the proper definition. There are three properties that it would be desirable to have, however the definition is made. (1) if $a$ is any element of a partially ordered set $P$, then the set of all elements $x$ of $P$ such that $x\geq a$ should turn out to be an ideal, namely the principal ideal determined by the element $a$. (2) The intersection of any number of ideals should be an ideal, so that the set of all ideals will form a complete lattice relative to the subset relation taken as the order relation. (3) In a partially ordered set which is also a lattice, sets which are ideals in the sense of lattice theory should turn out to be ideals according to the definition to be given for partially ordered sets, and conversely.

He then bases his definition on the notion of normal ideal that was studied by Stone, MacNeille, and Garrett Birkhoff: given a subset $A$, we let $A^*$ be the set of all upper bounds of $A$, and $A^+$ the set of all lower bounds of $A$. A "normal ideal" was a set $A$ such that $A=A^{*+} = (A^*)^+$. Frink defines:

Definition. A set $J$ of elements of a partially ordered set $P$ is called an ideal of $P$ if, whenever $F$ is a finite subset of $J$, the set $F^{*+}$ is also a subset of $J$.

E.S. Wolk discussed the "fruitfulness of this definition" in a paper on representations of partially ordered sets. Here it is in JSTOR.
So here we see a process whereby the extension first occurred by considering a special kind of ring (Boolean rings), then extending the notion "by analogy" to lattices, and finally to partially ordered sets with a view towards extending lattice theorems, particularly representation theorems.
However, there is another sense in which ideals for lattices and ideals for rings are instances of a particular kind of more general construction, as noted by Alex Youcis: the notion of congruence of an algebra (in the sense of universal algebra). 
Let $A$ be an algebra in the sense of universal algebra (a set together with a family of finitary operations); examples include semigroups (a single binary operation), monoids (a binary operation and a zeroary operation), groups (a binary, a unary, and a zeroary operation), rings, lattices, $R$-algebras, vector spaces, and many others. Say we have an equivalence relation $\sim$ on $A$, and we want to define an algebra structure on $A/\sim$ by "operating on representatives". E.g., in groups, we want to define the product of the equivalence classes $[a]$ and $[b]$ of $a,b\in A$ to be the equivalence class of the product. More generally, if $f\colon A^n\to A$ is an $n$-ary operation on $A$, we want to define an induced operation $\overline{f}\colon (A/\sim)^n\to (A/\sim)$ by
$$\overline{f}([a_1],\ldots,[a_n]) = [f(a_1,\ldots,a_n)].$$
Under what conditions will this be well-defined? 
Theorem. The induced operation on equivalence classes is well-defined if and only if $\sim$, when viewed as a subset of $A\times A$, is a subalgebra of $A\times A$ (where the latter has the coordinatewise algebra structure).
This leads to:
Definition. Let $A$ be an algebra (in the sense of universal algebra). A congruence on $A$ is an equivalence relation that is a subalgebra of $A\times A$.
In the case of groups, congruences are in one-to-one correspondence with normal subgroups: given a normal subgroup $N$, we define the equivalence relation $\sim$ by $a\sim b$ if and only if $aN=bN$. Conversely, given a congruence $\Phi\subseteq A\times A$, we let $N=\{a\in A\mid (a,e)\in \Phi\}$; it is then not hard to show that $A$ is normal and that $(a,b)\in \Phi$ if and only if $aN=bN$.
Similarly, for rings, congruences are in one-to-one correspondence with ideals. 
This does not hold for more general structures. We do have some connection: given a lattice $L$ and an ideal $J$ of $L$, we can define a relation $\Phi_J$ on $L$ by
$$ \Phi_J = \{ (a,b)\in L^2 \mid \exists c\in J (a\lor c = b\lor c)\}.$$
This is an equivalence relation on $L$. $(a,a)\in\Phi_J$ for all $a\in L$, since we can take any $c\in J$ to get $a\lor c = a\lor c$. It is also easy to verify that $(a,b)\in\Phi_J$ implies $(b,a)\in\Phi_J$. And if $(a,b),(b,c)\in \Phi_J$, with $x,y\in J$ such that $a\lor x = b\lor x$ and $b\lor y = c\lor y$, then 
$$a\lor(x\lor y) = (a\lor x)\lor y = (b\lor x)\lor y = c\lor y\lor x = c\lor(x\lor y)$$
and $x\lor y\in J$ because $J$ is an ideal, so $(a,c)\in \Phi_J$. 
For $\lor$-semilattices, $\Phi_J$ is a congruence on $L$: we need to verify that if $(a,b),(c,d)\in\Phi_J$, then $(a,b)\lor(c,d) = (a\lor b,c\lor d)$ is in $\Phi_J$. Indeed, if $a\lor x = b\lor x$ and $c\lor y=d\lor y$, then 
$$(a\lor c)\lor(x\lor y) = (a\lor x)\lor(c\lor y) = (b\lor x)\lor(d\lor y) = (b\lor d)\lor(x\lor y),$$
and $x\lor y\in J$ because $J$ is an ideal. 
If $L$ is a distributive lattice, then we also get that $\Phi_J$ is closed under meets, so that $J$ determines a congruence. In fact, 

Proposition. The lattice $L$ is distributive if and only if for every ideal $J$ of $L$, the relation $\Phi_J$ is a congruence on $L$ and $J$ is an equivalence class of the corresponding partition. 

In a Boolean algebra (and more generally, as noted by Martin Sleziak, in a generalized boolean lattice) every congruence is of the form $\Phi_J$ for some ideal $J$, but in an arbitrary distributive lattice, there may be congruences that are not induced by ideals. 
(By the way, the same thing happens in semigroups, which also have a notion of "ideal"; see, e.g., Wikipedia; every ideal induces a congruence, but not every congruence is induced by an ideal. The notion of "ideal" in semigroups is also by analogy to "ideal" in rings, where an ideal of the ring forms an ideal of the multiplicative semigroup of the ring). 
A: I believe what you are looking for is the notion of a "congruence" in universal algebra. See page 38 of this PDF.
EDIT: I was mistaken, please read boumol's comment below to see why.
