# כיצד להריץ קוד בצד השרת בלחיצה על כפתור?

**URL:** <https://meta.discourse.org/t/how-to-execute-server-side-code-when-clicking-a-button/265795>\
**Category:** Development\
**Created:** [19 במאי,‏ 2023,‏ 3:03pm UTC](https://meta.discourse.org/t/how-to-execute-server-side-code-when-clicking-a-button/265795 "2023-05-19T15:03:07Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [20 במאי,‏ 2023,‏ 2:14pm UTC](https://meta.discourse.org/t/how-to-execute-server-side-code-when-clicking-a-button/265795/7 "2023-05-20T14:14:45Z")

</div>

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

See: [ActiveRecord::Batches](https://api.rubyonrails.org/v7.0.4.2/classes/ActiveRecord/Batches.html)

---

_[View the full topic](https://meta.discourse.org/t/how-to-execute-server-side-code-when-clicking-a-button/265795)._
