Sha256: 0ee278d5714161239c9c47506ec0d3ce659a71a28dc69df0d73f3f306a0349b0
Contents?: true
Size: 719 Bytes
Versions: 11
Compression:
Stored size: 719 Bytes
Contents
module Admin class CurrentSitesController < BaseController sections 'settings', 'site' def edit @site = current_site end def update @site = current_site if @site.update_attributes(params[:site]) flash_success! redirect_to edit_admin_current_site_url(new_host_if_subdomain_changed) else flash_error! render :action => :edit end end protected def new_host_if_subdomain_changed host_from_site = "#{@site.subdomain}.#{Locomotive.config.default_domain}" if request.host == host_from_site {} else { :host => "#{host_from_site}:#{request.port}" } end end end end
Version data entries
11 entries across 11 versions & 1 rubygems