aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/mini_environments_controller.rb
blob: c45ed4a1a23e5242c632d21ca4c869a8e7cbd5f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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