Javascript action and rails action in 1 button

Hi guys,
How can I have 1 button to actually call both javascript(which is
embeded in in rhtml) function and ruby function?

Thank you