Sha256: 300b4adc8be36f0bb2b9b922ca3214e4f88a6dc357483961565a3a7059e5ac0d

Contents?: true

Size: 689 Bytes

Versions: 6

Compression:

Stored size: 689 Bytes

Contents

module Admin
  class SitesController < BaseController

    sections 'settings'

    def create
      @site = Site.new(params[:site])
      @site.memberships.build :account => @current_admin, :admin => true

      create! { edit_admin_my_account_url }
    end

    def destroy
      @site = current_admin.sites.detect { |s| s._id == params[:id] }

      if @site != current_site
        @site.destroy
      else
        @site.errors.add(:base, 'Can not destroy the site you are logging in now')
      end

      respond_with @site, :location => edit_admin_my_account_url
    end

    protected

    def begin_of_association_chain; nil; end # not related directly to current_site

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
locomotive_cms-0.0.4.beta5 app/controllers/admin/sites_controller.rb
locomotive_cms-0.0.4.beta4 app/controllers/admin/sites_controller.rb
locomotive_cms-0.0.4.beta3 app/controllers/admin/sites_controller.rb
locomotive_cms-0.0.4.beta2 app/controllers/admin/sites_controller.rb
locomotive_cms-0.0.4.beta1 app/controllers/admin/sites_controller.rb
locomotive_cms-0.0.4 app/controllers/admin/sites_controller.rb