pages_controller.rb 604 Bytes
Newer Older
1 2 3
class Projects::PagesController < Projects::ApplicationController
  layout 'project_settings'

4
  before_action :require_pages_enabled!
Kamil Trzcinski's avatar
Kamil Trzcinski committed
5 6
  before_action :authorize_read_pages!, only: [:show]
  before_action :authorize_update_pages!, except: [:show]
7

8
  def show
9
    @domains = @project.pages_domains.order(:domain)
10 11
  end

12
  def destroy
Kamil Trzcinski's avatar
Kamil Trzcinski committed
13 14
    project.remove_pages
    project.pages_domains.destroy_all
Kamil Trzcinski's avatar
Kamil Trzcinski committed
15 16 17 18 19 20 21

    respond_to do |format|
      format.html  do
        redirect_to(namespace_project_pages_path(@project.namespace, @project),
                    notice: 'Pages were removed')
      end
    end
Kamil Trzcinski's avatar
Kamil Trzcinski committed
22
  end
23
end