Class: Maglev::SiteController

Inherits:
ApplicationController show all
Defined in:
app/controllers/maglev/site_controller.rb

Instance Method Summary collapse

Methods included from ResourceIdConcern

#resource_id

Instance Method Details

#createObject



5
6
7
8
9
10
11
12
13
# File 'app/controllers/maglev/site_controller.rb', line 5

def create
  redirect_to editor_root_path and return if Maglev::Site.exists? || !Rails.env.local?

  Maglev::GenerateSite.call(
    theme: Maglev.local_themes.first
  )

  redirect_to editor_root_path
end