开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜