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

4
  before_action :authorize_update_pages!
5

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

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

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