Sha256: 7de7106151550d6594f6c65db57b8ab6cfdf62515307bce411a4d4dba4879e33

Contents?: true

Size: 728 Bytes

Versions: 8

Compression:

Stored size: 728 Bytes

Contents

module Admin
  class SitesController < BaseController

    defaults :instance_name => 'site'

    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

8 entries across 8 versions & 1 rubygems

Version Path
locomotive_cms-1.0.0.beta.2 app/controllers/admin/sites_controller.rb
locomotive_cms-1.0.0.beta app/controllers/admin/sites_controller.rb
locomotive_cms-0.0.4.beta12 app/controllers/admin/sites_controller.rb
locomotive_cms-0.0.4.beta11 app/controllers/admin/sites_controller.rb
locomotive_cms-0.0.4.beta10 app/controllers/admin/sites_controller.rb
locomotive_cms-0.0.4.beta9 app/controllers/admin/sites_controller.rb
locomotive_cms-0.0.4.beta8 app/controllers/admin/sites_controller.rb
locomotive_cms-0.0.4.beta7 app/controllers/admin/sites_controller.rb