From eb3177b0d8de10f316ac595dff3b8165cf828796 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 27 Jan 2018 23:23:05 +0000 Subject: Initial commit --- app/controllers/mini_environments_controller.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 app/controllers/mini_environments_controller.rb (limited to 'app/controllers/mini_environments_controller.rb') 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 -- cgit v1.2.3