Sha256: b97528a4cbe034467e55a38a5c86924d7bb8242abef8680c1af39729e4f68e1e

Contents?: true

Size: 681 Bytes

Versions: 32

Compression:

Stored size: 681 Bytes

Contents

module Locomotive
  class SitesController < BaseController

    account_required

    layout '/locomotive/layouts/account'

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

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

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

    private

    def service
      @service ||= Locomotive::SiteService.new(self.current_locomotive_account)
    end

    def site_params
      params.require(:site).permit(:name, :handle)
    end

  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
locomotivecms-4.1.1 app/controllers/locomotive/sites_controller.rb
locomotivecms-4.1.0 app/controllers/locomotive/sites_controller.rb
locomotivecms-4.1.0.rc1 app/controllers/locomotive/sites_controller.rb
locomotivecms-4.0.3 app/controllers/locomotive/sites_controller.rb
locomotivecms-4.0.2 app/controllers/locomotive/sites_controller.rb
locomotivecms-4.0.1 app/controllers/locomotive/sites_controller.rb
locomotivecms-4.0.0 app/controllers/locomotive/sites_controller.rb
locomotivecms-4.0.0.rc0 app/controllers/locomotive/sites_controller.rb
locomotivecms-4.0.0.alpha3 app/controllers/locomotive/sites_controller.rb
locomotivecms-3.4.1 app/controllers/locomotive/sites_controller.rb
locomotivecms-4.0.0.alpha2 app/controllers/locomotive/sites_controller.rb
locomotivecms-4.0.0.alpha1 app/controllers/locomotive/sites_controller.rb
locomotivecms-3.4.0 app/controllers/locomotive/sites_controller.rb
locomotivecms-3.3.0 app/controllers/locomotive/sites_controller.rb
locomotivecms-3.3.0.rc3 app/controllers/locomotive/sites_controller.rb
locomotivecms-3.3.0.rc2 app/controllers/locomotive/sites_controller.rb
locomotivecms-3.1.2 app/controllers/locomotive/sites_controller.rb
locomotivecms-3.2.1 app/controllers/locomotive/sites_controller.rb
locomotivecms-3.3.0.rc1 app/controllers/locomotive/sites_controller.rb
locomotivecms-3.2.0 app/controllers/locomotive/sites_controller.rb