Reputation: 8422
what is the main difference between these two callbacks ?
after_create do
# ...
end
and
after_create :some_method
def some_method
# ....
end
Upvotes: 0
Views: 53
Reputation: 2656
To wrap things up:
There is no difference in behaviour. First one is yielding the block while the second option is calling a method. The latter is more common though.
Controllers have after_filter
and before_filter
callbacks, which is working in the same way
Upvotes: 1