Commit eb4efde1 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix the remove_pages

parent 87a43577
......@@ -51,6 +51,11 @@ class Projects::PagesController < Projects::ApplicationController
end
end
def remove_pages
project.remove_pages
project.pages_domains.destroy_all
end
private
def pages_domain_params
......
......@@ -43,7 +43,7 @@ module Projects
end
def pages_config_file
File.join(pages_path, 'config.jso')
File.join(pages_path, 'config.json')
end
def update_file(file, data)
......@@ -52,7 +52,7 @@ module Projects
file.write(data)
end
else
File.rm_r(file)
File.rm(file, force: true)
end
end
end
......
......@@ -2,9 +2,10 @@
%h3.page_title
Pages
= link_to new_namespace_project_page_path(@project.namespace, @project), class: "btn btn-new pull-right", title: "New Domain" do
%i.fa.fa-plus
New Domain
- if Settings.pages.external_http || Settings.pages.external_https
= link_to new_namespace_project_page_path(@project.namespace, @project), class: "btn btn-new pull-right", title: "New Domain" do
%i.fa.fa-plus
New Domain
%p.light
With GitLab Pages you can host for free your static websites on GitLab.
......
......@@ -547,7 +547,9 @@ Rails.application.routes.draw do
end
resources :pages, except: [:edit, :update] do
delete :remove_pages
collection do
delete :remove_pages
end
end
resources :compare, only: [:index, :create]
resources :network, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment