diff --git a/app/controllers/admin/communication/websites/pages_controller.rb b/app/controllers/admin/communication/websites/pages_controller.rb index 884bfd595819522fbe03b6c040877eb5c3536028..cad0b279aa86865e4a37242adf4c8a504d736b7a 100644 --- a/app/controllers/admin/communication/websites/pages_controller.rb +++ b/app/controllers/admin/communication/websites/pages_controller.rb @@ -58,8 +58,8 @@ class Admin::Communication::Websites::PagesController < Admin::Communication::We redirect_back(fallback_location: [:admin, @object]) end - def generate - @page.generate + def generate_from_template + @page.generate_from_template redirect_back(fallback_location: [:admin, @page]) end diff --git a/app/models/communication/website/page/accessibility.rb b/app/models/communication/website/page/accessibility.rb index 939cba9baf8d787042ad92a1d3f78c6812246bb5..d88be5e4003cbf1badef05c564053f3e0c597655 100644 --- a/app/models/communication/website/page/accessibility.rb +++ b/app/models/communication/website/page/accessibility.rb @@ -52,7 +52,7 @@ class Communication::Website::Page::Accessibility < Communication::Website::Page false end - def generate + def generate_from_template generate_declaration generate_results generate_conformity diff --git a/app/models/communication/website/page/with_type.rb b/app/models/communication/website/page/with_type.rb index 97e85fb272f19458805e794925539d611a6d1061..9be49421097baed6b5c38826ed99c04d3a5346ad 100644 --- a/app/models/communication/website/page/with_type.rb +++ b/app/models/communication/website/page/with_type.rb @@ -85,6 +85,9 @@ module Communication::Website::Page::WithType nil end + def generate_from_template + end + protected def default_parent diff --git a/config/routes/admin/communication.rb b/config/routes/admin/communication.rb index 2bf8317ecf855607321de91fd98a8244300d1a4a..94a5fe3e40a0d6e69c08103e205995243c31df5d 100644 --- a/config/routes/admin/communication.rb +++ b/config/routes/admin/communication.rb @@ -25,7 +25,7 @@ namespace :communication do post :duplicate post :connect post :disconnect - post :generate + post 'generate-from-template' => 'websites/pages#generate_from_template', as: :generate end end resources :categories, controller: 'websites/categories', path: '/:lang/categories' do