1

How do I intercept the update action and override it in the resource.rb file, not in the controller.

Jay Dorsey
  • 3,563
  • 2
  • 18
  • 24
Chinmaya
  • 21
  • 1

1 Answers1

1

There's a before_update hook that exists as a resource callback. Per the documentation this is the suggested option in the latest stable guide

Note: The authors of this gem expect the most common uses cases to be
handled using the callbacks. It is likely that the internal functionality 
of the operation processing methods will change, at least for several
revisions. Effort will be made to call this out in release notes. You 
have been warned.

If you want to overwrite the entire action, I believe you need to write your own custom processor. I think for an update you need to look at replace fields. I would start with the update action and follow process_request down the chain.

Jay Dorsey
  • 3,563
  • 2
  • 18
  • 24