diff options
author | Rob Watson <rob@mixlr.com> | 2018-01-03 11:07:03 +0300 |
---|---|---|
committer | Rob Watson <rob@mixlr.com> | 2018-03-22 21:58:36 +0300 |
commit | 9d45951fcaeda4f01a2e4be2480d980a3e7cd37e (patch) | |
tree | 536b456729edad79ba718d987a39f235587d4dfb /app/controllers | |
parent | 53d352aaf4ce7f0d2bcaf04cce5252b753ef7938 (diff) |
Add HTTPS-only pages
Closes #28857
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/pages_controller.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/controllers/projects/pages_controller.rb b/app/controllers/projects/pages_controller.rb index d421b1a8eb5..cae6e2c40b8 100644 --- a/app/controllers/projects/pages_controller.rb +++ b/app/controllers/projects/pages_controller.rb @@ -21,4 +21,26 @@ class Projects::PagesController < Projects::ApplicationController end end end + + def update + result = Projects::UpdateService.new(@project, current_user, project_params).execute + + respond_to do |format| + format.html do + if result[:status] == :success + flash[:notice] = 'Your changes have been saved' + else + flash[:alert] = 'Something went wrong on our end' + end + + redirect_to project_pages_path(@project) + end + end + end + + private + + def project_params + params.require(:project).permit(:pages_https_only) + end end |