Its abit hard to do it but it does work.
Start with standing next to your mount aiming at it with staff sheated.
Then at almost the same time you press in this order -> spell -> unsheat -> usebutton -> spam spell and left click.
You will notice if it works by completing the spell while sitting on the mount,
if you got that faar you can select any selfbuff/heal etc and while running forward or backwards you can cast the spell.
Rays and wall of force works aswell but you can not really aim them, they go straight behind the mount so if someone is chasing they will get hit. Confusion also work.
You can also do this with Bow (totally useless afaik since you can only hit your mount with it)

2h weapons also works but its really hard to hit with them. so its only cool by the looks

i also made a macro for it in autohotkey wich makes it abit easier do accomplish it with a staff since it the hardest one to do. may have to tweak it due to ping etc but this works for me in a couple of tries :p
Wheelup::
{
Send {F7} <---- the spell
Sleep, 10
Send {R} <---- unsheat (not toggle sheat/unsheat)
Send {F} <---- use key
Sleep, 30
Send {R}
Sleep, 10
Send {F7}
Send {F7}
Send {F7}
Send {F7}
Send {F7}
Send {F7}
Send {click}
Send {click}
Send {click}
Send {click}
Send {click}
Send {click}
Send {click}
Send {click}
return
}