what’s the best place for code that’s used in several controllers?
i have a site with several namespaces.
one for admin and one for client (and some more)
adding a new client is a (relative) complex process
involving entries in several tables and creating folders
to upload files.
for example a client can create his own account but the admin can do
the same of course, so they share a lot of code.
does this code belong to the model since it’s business logic?
but then the client model would make entries in the address model (and a
application.rb would be another option, but it’s quite a lot of code
(and the client controller is not the only one), so this would become a
very large file then…
or is it better to create a lib (or several libs)?
make one lib per controller? or one lib per model?
What’s the best practice to place this shared logic?