El mar, 17-01-2017 a las 11:42 +0100, Björn Geuken escribió:
On 01/13/2017 10:43 AM, Evan Rolfe wrote:
Hi all, I have a PR in which I've started to use namespaces to organise some new controllers and wanted to make sure everybody is onboard with this pattern since currently the only namespace we have in the controllers is Webui.
https://github.com/openSUSE/open-build-service/pull/2544
Those controllers are:
Source::KeyInfoController (https://github.com/evanrolfe/open-build-service/blob/8f016cb6b731e 7d4261e4e268e7b2c84467d87cf/src/api/app/controllers/source/key_info _controller.rb)
Webui::Projects::PublicKeyController (https://github.com/evanrolfe/open-build-service/blob/8f016cb6b731e 7d4261e4e268e7b2c84467d87cf/src/api/app/controllers/webui/projects/ public_key_controller.rb)
Webui::Projects::SslCertificateController (https://github.com/evanrolfe/open-build-service/blob/8f016cb6b731e 7d4261e4e268e7b2c84467d87cf/src/api/app/controllers/webui/projects/ ssl_certificate_controller.rb)
In the case of Source::KeyInfoController this is an alternative to adding another method to SourceController which already has > 1600 lines. Namespacing will also allow us to follow a "one-controller-per-resource" (REST) pattern which would make the controller code simpler and more uniform.
Here is a pretty good article about this from our "Lord and Savior DHH™" http://jeromedalbert.com/how-dhh-organizes-his-rails-controllers/
Please let me know what you think.
-Evan
Hey,
I like the idea. Seems to be a nice way to structure our code.
Cheers Björn
-- Björn Geuken - Rails Developer - Open Build Service SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 21284 (AG Nürnberg)
I agree, it will help us to be closer to having a REST API using the same code Regards -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org