D
D
Dima2015-06-01 12:31:49
Ruby on Rails
Dima, 2015-06-01 12:31:49

Where to place the class describing the exception?

Hello. Where should exception classes be placed in Ruby on Rails? Interested in which directory / file. Is it possible to create a separate file for the code of classes describing exceptions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Vsk, 2015-06-01
@MAXOPKA

There is no standard.
This is how they do it in rails, for example:
https://github.com/rails/rails/blob/master/activer...
If there are few errors, I would first add them to the initializers. If there is a lot, then I would have already added an additional directory to autoload (app/errors/) and divided it by namespaces

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question