Skip to content

Commit

Permalink
Generate static pages with High Voltage (#2)
Browse files Browse the repository at this point in the history
This is much cleaner and also fixes a security issue.
  • Loading branch information
irisfaraway committed Nov 17, 2017
1 parent e2357d1 commit fa47249
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 19 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ gem "devise", "~> 4.3"
gem "govuk_elements_rails", "~> 3.1"
gem "govuk_template", "~> 0.23"

# Use High Voltage for static pages
gem "high_voltage"

group :development, :test do
# Call "byebug" anywhere in the code to stop execution and get a debugger console
gem "byebug"
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ GEM
sass (>= 3.2.0)
govuk_template (0.23.0)
rails (>= 3.1)
high_voltage (3.0.0)
i18n (0.9.0)
concurrent-ruby (~> 1.0)
jbuilder (2.7.0)
Expand Down Expand Up @@ -224,6 +225,7 @@ DEPENDENCIES
factory_bot_rails
govuk_elements_rails (~> 3.1)
govuk_template (~> 0.23)
high_voltage
jbuilder (~> 2.0)
jquery-rails
mongoid (~> 5.2)
Expand Down
15 changes: 0 additions & 15 deletions app/controllers/pages_controller.rb

This file was deleted.

4 changes: 2 additions & 2 deletions app/views/shared/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= t(".support_text") %>
</p>
<ul>
<li class="inline"><%= link_to 'Privacy', "/pages/privacy", target: "_blank" %></li>
<li class="inline"><%= link_to 'Cookies', "/pages/cookies", target: "_blank" %></li>
<li class="inline"><%= link_to 'Privacy', page_path("privacy"), target: "_blank" %></li>
<li class="inline"><%= link_to 'Cookies', page_path("cookies"), target: "_blank" %></li>
</ul>
</div>
2 changes: 0 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@

resources :registrations

get "/pages/:page" => "pages#show"

root "registrations#index"
end

0 comments on commit fa47249

Please sign in to comment.