Rails - Grails Service Equivalent -
When you want to write an internal service layer in Rail 3, where should you put the code? I am coming from the background of Grails and wondering what is the same in the service of the train.
In addition, if it is included in this article or online video - it would be nice to see the link. Thank you.
In this case, rail conferences generally refer to this item in Lib folder (i.e.; lib / services / erp_service .rb). I have created a 'Services' folder under the 'app' directory, in which the services have been included in this way in the past. I do not believe that you need to do some extra to load a class, even though you want to keep your services under the 'app' directory and they are not loaded, you can mess with the config You can try Autoload_paths option from application.rb (in a Rail 3.x application)
Custom directories with # class and module which you want to be autoloadable # Config.autoload_paths + =% W (# {config.root} / extr As) config.autoload_paths + =% W (# {config.root} / lib
Comments
Post a Comment