Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 546 Bytes

README.md

File metadata and controls

20 lines (15 loc) · 546 Bytes

ActionField

Call actions on ActiveRecord fields before update or create.

Usage

Simple

  action_field strip: [:first_name, :last_name]

The above code will call strip method on first_name, and last_name to field before update or create.

More granular callback control

  action_field strip: [:first_name, :last_name], on: [:create]

The above code will call strip method on first_name, and last_name to field before create.

License

The code is on MIT license, feel free to use it or fork it. Or even send me a PR.