plutonium-interaction
Installation
SKILL.md
Plutonium Interactions
🚨 Critical (read first)
ActiveRecord::RecordInvalidis NOT rescued automatically. Always rescue it when usingcreate!/update!/save!and returnfailed(e.record.errors).- Return
succeed(...)orfailed(...)fromexecute— the controller won't know what happened otherwise. - Redirect is automatic on success. Only call
with_redirect_responsefor a different destination. - Bulk actions use
resources(plural). Policy methods are checked per record; if any fails, the whole request fails. - Related skills:
plutonium-definition(registering actions),plutonium-policy(authorizing actions),plutonium-forms(interaction form templates).
Interactions encapsulate business logic into reusable, testable units. They handle input validation, execution, and outcomes.
Basic Structure
# app/interactions/resource_interaction.rb (generated during install)
class ResourceInteraction < Plutonium::Resource::Interaction
end