aboutsummaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-03-16 08:51:54 +0000
committerChristopher Baines <mail@cbaines.net>2018-03-29 07:55:01 +0100
commit051c8bf612126fa79699c8bf45a661dde127f4a0 (patch)
tree849a3b05b4ab4b59a426761d7cf1da3cc7036349 /app/helpers
parenta8c8f68971dd9e20dee01d9f65c64283e41fe4a3 (diff)
downloadgovuk-mini-environment-admin-051c8bf612126fa79699c8bf45a661dde127f4a0.tar
govuk-mini-environment-admin-051c8bf612126fa79699c8bf45a661dde127f4a0.tar.gz
Add backend controllers, models and views
Also annotate existing models.
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/backends/terraform_aws_helper.rb2
-rw-r--r--app/helpers/backends/terraform_libvirt_helper.rb2
-rw-r--r--app/helpers/backends_helper.rb20
-rw-r--r--app/helpers/setup_helper.rb2
4 files changed, 26 insertions, 0 deletions
diff --git a/app/helpers/backends/terraform_aws_helper.rb b/app/helpers/backends/terraform_aws_helper.rb
new file mode 100644
index 0000000..b17f988
--- /dev/null
+++ b/app/helpers/backends/terraform_aws_helper.rb
@@ -0,0 +1,2 @@
+module Backends::TerraformAwsHelper
+end
diff --git a/app/helpers/backends/terraform_libvirt_helper.rb b/app/helpers/backends/terraform_libvirt_helper.rb
new file mode 100644
index 0000000..736fdfe
--- /dev/null
+++ b/app/helpers/backends/terraform_libvirt_helper.rb
@@ -0,0 +1,2 @@
+module Backends::TerraformLibvirtHelper
+end
diff --git a/app/helpers/backends_helper.rb b/app/helpers/backends_helper.rb
new file mode 100644
index 0000000..6888611
--- /dev/null
+++ b/app/helpers/backends_helper.rb
@@ -0,0 +1,20 @@
+module BackendsHelper
+ def new_backend_path(backend_class)
+ route_helper("new_#{backend_class.name.demodulize.underscore}_backend_path")
+ end
+
+ def show_backend_path(backend)
+ route_helper(
+ "#{backend.class.name.demodulize.underscore}_backend_path",
+ backend.id
+ )
+ end
+
+ def route_helper(name, *args)
+ Rails
+ .application
+ .routes
+ .url_helpers
+ .send(name, *args)
+ end
+end
diff --git a/app/helpers/setup_helper.rb b/app/helpers/setup_helper.rb
new file mode 100644
index 0000000..89cc8d2
--- /dev/null
+++ b/app/helpers/setup_helper.rb
@@ -0,0 +1,2 @@
+module SetupHelper
+end