Class: Admin::SitesController

Inherits:
ResourceController
  • Object
show all
Defined in:
app/controllers/admin/sites_controller.rb

Instance Method Summary collapse

Instance Method Details

#newObject



7
8
9
# File 'app/controllers/admin/sites_controller.rb', line 7

def new
  model.hostnames.build
end

#switch_toObject



11
12
13
14
15
16
17
18
# File 'app/controllers/admin/sites_controller.rb', line 11

def switch_to
  site = Site.find(params[:id])
  if site
    redirect_to "http://#{site.hostnames.first.domain}#{request.port.to_s == '80' ? '' : ":#{request.port}"}/admin"
  else
    render :index
  end 
end