Masturbation is haram whether in Ramadan or otherwise. It invalidates the fast and requires a tawba and a make up of the day. The evidence for it is in the words of Allah in the following hadith qudsi:
“He gives up his food and drink and desire for My sake.” [Bukhari and Muslim]
Causing ejaculation comes under the heading of the desire which the fasting person gives up. If a person starts to masturbate then stops without ejaculating, he has to repent, but his fast is still valid, and he does not have to make it up later because he did not ejaculate.
With regard to the emission of madhiy (light cloudy prostatic fluid), the most correct view is that it does not invalidate the fast.