How to execute server-side code when clicking a button?

Just run it at the rails console and don’t write a plugin.