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

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

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

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

    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
21
  end
22
end