Yeah, it really belongs in the model...
On May 28, 9:42 am, Gavin <[email protected]> wrote:
> Vipin,
>
> wouldn't it be better moving this out of the controller altogether?
>
> If every A should have a B then I'd create an observer - "AObserver"
>
> and add an after_create callback:
>
> class AObserver < ActiveRecord::Observer
>
> def after_create(a)
> B.create! :a_id => a.id
> end
> end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---