diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index edccfba3e..d570e2c5b 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -1,6 +1,6 @@ class PagesController < ApplicationController # No authorization required for entirely public controller - before_action :set_cache_control_headers, only: %i[show rlyweb now survey badge shecoded] + before_action :set_cache_control_headers, only: %i[show rlyweb now survey badge shecoded bounty faq] def show @page = Page.find_by!(slug: params[:slug]) @@ -21,6 +21,18 @@ class PagesController < ApplicationController set_surrogate_key_header "about_page" end + def faq + @page = Page.find_by(slug: "faq") + render :show if @page + set_surrogate_key_header "faq_page" + end + + def bounty + @page = Page.find_by(slug: "security") + render :show if @page + set_surrogate_key_header "bounty_page" + end + def badge @html_variant = HtmlVariant.find_for_test([], "badge_landing_page") render layout: false diff --git a/app/models/page.rb b/app/models/page.rb index 00f9da6d5..b859baad6 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -6,7 +6,7 @@ class Page < ApplicationRecord validate :body_present before_save :evaluate_markdown - before_save :bust_cache + after_save :bust_cache before_validation :set_default_template mount_uploader :social_image, ProfileImageUploader @@ -31,7 +31,9 @@ class Page < ApplicationRecord end def bust_cache - CacheBuster.new.bust "/page/" + CacheBuster.new.bust "/page/#{slug}" CacheBuster.new.bust "/page/#{slug}?i=i" + CacheBuster.new.bust "/#{slug}" + CacheBuster.new.bust "/#{slug}?i=i" end end diff --git a/app/views/pages/information.html.erb b/app/views/pages/information.html.erb index c39014060..80889bf79 100644 --- a/app/views/pages/information.html.erb +++ b/app/views/pages/information.html.erb @@ -50,7 +50,7 @@
- Last Updated: