Sha256: b8cc6f102075cce5e54397b209b6044b63aecebfa2855f1c9677b0c2a11f5314

Contents?: true

Size: 692 Bytes

Versions: 44

Compression:

Stored size: 692 Bytes

Contents

# frozen_string_literal: true

module Alchemy
  module Admin
    class SitesController < ResourcesController
      def create
        @site = Alchemy::Site.new(resource_params)
        if @site.save
          flash[:notice] = Alchemy.t("Please create a default language for this site.")
          do_redirect_to alchemy.admin_languages_path(site_id: @site)
        else
          render :new
        end
      end

      def destroy
        if @site.destroy
          flash[:notice] = Alchemy.t("Site successfully removed")
        else
          flash[:warning] = @site.errors.full_messages.to_sentence
        end
        do_redirect_to alchemy.admin_sites_path
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
alchemy_cms-7.0.8 app/controllers/alchemy/admin/sites_controller.rb
alchemy_cms-7.0.7 app/controllers/alchemy/admin/sites_controller.rb
alchemy_cms-7.0.6 app/controllers/alchemy/admin/sites_controller.rb
alchemy_cms-7.0.5 app/controllers/alchemy/admin/sites_controller.rb