aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/mini_environments_controller.rb
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-01-27 23:23:05 +0000
committerChristopher Baines <mail@cbaines.net>2018-03-29 07:28:05 +0100
commiteb3177b0d8de10f316ac595dff3b8165cf828796 (patch)
tree501b338a14a3cedc71c9a33a17d5810848374572 /app/controllers/mini_environments_controller.rb
downloadgovuk-mini-environment-admin-eb3177b0d8de10f316ac595dff3b8165cf828796.tar
govuk-mini-environment-admin-eb3177b0d8de10f316ac595dff3b8165cf828796.tar.gz
Initial commit
Diffstat (limited to 'app/controllers/mini_environments_controller.rb')
-rw-r--r--app/controllers/mini_environments_controller.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/app/controllers/mini_environments_controller.rb b/app/controllers/mini_environments_controller.rb
new file mode 100644
index 0000000..c45ed4a
--- /dev/null
+++ b/app/controllers/mini_environments_controller.rb
@@ -0,0 +1,21 @@
+class MiniEnvironmentsController < ApplicationController
+ def show
+ @mini_environment = MiniEnvironment.find(params[:id])
+ end
+
+ def new
+ @mini_environment = MiniEnvironment.new
+ end
+
+ def create
+ ActiveRecord::Base.transaction do
+ @mini_environment = MiniEnvironment.create(
+ params.require(:mini_environment).permit(:name)
+ )
+
+ SetupJob.enqueue(@mini_environment.id)
+ end
+
+ redirect_to @mini_environment
+ end
+end