0

I'd like to run a script that does some evaluation of user-entered data after it is successfully created. I have a model representing the data, but how do I specify that the model class should execute function X after an instance is successfully created?

Part 2: would it be more appropriate to put the code I want to execute in with the model or with the helper?

Thanks for your help :)

1 Answer 1

1

I believe you want an after_create callback in the model.

http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html#M001375

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.