Commit e5e2e7b7 authored by Kamil Trzcinski's avatar Kamil Trzcinski Committed by James Edwards-Jones

Fix the remove_pages

parent 13b6bad1
...@@ -51,6 +51,11 @@ class Projects::PagesController < Projects::ApplicationController ...@@ -51,6 +51,11 @@ class Projects::PagesController < Projects::ApplicationController
end end
end end
def remove_pages
project.remove_pages
project.pages_domains.destroy_all
end
private private
def pages_domain_params def pages_domain_params
......
...@@ -43,7 +43,7 @@ module Projects ...@@ -43,7 +43,7 @@ module Projects
end end
def pages_config_file def pages_config_file
File.join(pages_path, 'config.jso') File.join(pages_path, 'config.json')
end end
def update_file(file, data) def update_file(file, data)
...@@ -52,7 +52,7 @@ module Projects ...@@ -52,7 +52,7 @@ module Projects
file.write(data) file.write(data)
end end
else else
File.rm_r(file) File.rm(file, force: true)
end end
end end
end end
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
%h3.page_title %h3.page_title
Pages Pages
- 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 = link_to new_namespace_project_page_path(@project.namespace, @project), class: "btn btn-new pull-right", title: "New Domain" do
%i.fa.fa-plus %i.fa.fa-plus
New Domain New Domain
......
...@@ -40,8 +40,10 @@ constraints(ProjectUrlConstrainer.new) do ...@@ -40,8 +40,10 @@ constraints(ProjectUrlConstrainer.new) do
end end
resources :pages, except: [:edit, :update] do resources :pages, except: [:edit, :update] do
collection do
delete :remove_pages delete :remove_pages
end end
end
resources :compare, only: [:index, :create] do resources :compare, only: [:index, :create] do
collection do collection do
......
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