views:

21

answers:

1

Hi all,

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  A: 

I believe you want an after_create callback in the model.

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

fd
Exactly what I was looking for, thank you!
Loyal Tingley