Class: Locomotive::SitesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/locomotive/sites_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



20
21
22
23
24
# File 'app/controllers/locomotive/sites_controller.rb', line 20

def create
  authorize Site
  @site = service.create(site_params)
  respond_with @site, location: -> { dashboard_path(@site) }
end

#indexObject



8
9
10
11
12
# File 'app/controllers/locomotive/sites_controller.rb', line 8

def index
  authorize Site
  @sites = service.list
  respond_with @sites
end

#newObject



14
15
16
17
18
# File 'app/controllers/locomotive/sites_controller.rb', line 14

def new
  authorize Site
  @site = service.build_new
  respond_with @site
end