开发者

Should I store my Rails 3 observers in the app/models directory?

开发者 https://www.devze.com 2023-02-09 02:21 出处:网络
or do th开发者_开发技巧ey belong in their own place?I agree with the convention, but when you find you\'ve got a lot of observers in app/models, you might want to go ahead and store all your observers

or do th开发者_开发技巧ey belong in their own place?


I agree with the convention, but when you find you've got a lot of observers in app/models, you might want to go ahead and store all your observers in app/observers. (There are also some gems to help streamline your design).

Just remember to add app/observers to your app's configured load path.


If you generate one (e.g., "rails g observer Test") that's where it goes, so I'd stick with the convention.

0

精彩评论

暂无评论...
验证码 换一张
取 消