Hoe voer ik server-side code uit bij het klikken op een knop?

Use the language features and do as @pfaffman suggests. Writing a bespoke front end hook to achieve this is seriously OTT.

See: ActiveRecord::Batches