Ruby on Rails
Saturday, June 27, 2015
Thank you Elizabeth. I'm new to Rails so poking around in the Rails source is insightful.
-- Usually the test case is a good guide for how to use a piece of code. The interceptor is declared right inside the test case. The documentation and the test seem to imply that I should declare the interceptor and the registration in the same file and place it inside the initializers folder.
I'm implementing an email interceptor that redirects outbound email to a testing email account during development, so I added an interceptors folder under config and put the registration in development.rb. This seems a sensible place for interceptors to live. It also registers the interceptor only under the right circumstance.
Feedback about this is appreciated,
Feedback about this is appreciated,
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/414ca289-9e44-4627-989e-ef3dcde55bd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment