Devices such as capillaries for capillary electrophoresis are formed by
contacting a gel precursor with a substrate comprising a permeable
material that has higher permeability for organic solvents than water.
The gel precursor is made of a water soluble polymer having hydrophobic
moieties in a solvent mixture comprising water and an organic solvent,
wherein in the absence of the organic solvent, the polymer forms a
self-assembled gel. The organic solvent is allowed to permeate through
the permeable material resulting in the formation of the self-assembled
gel.