Skip to content

Commit

Permalink
Merge pull request #146 from TechforgoodCAST/develop
Browse files Browse the repository at this point in the history
Force SSL and JS on preview page
  • Loading branch information
suninthesky authored Apr 12, 2017
2 parents 99965b9 + 3107ef6 commit 50d4354
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class ApplicationController < ActionController::Base
force_ssl if: :ssl_configured?

# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
Expand All @@ -18,6 +20,10 @@ def logged_in?

include StrongParameters

def ssl_configured?
ENV['RACK_ENV'] == 'production'
end

def error?
params[:controller] == 'errors'
end
Expand Down
2 changes: 2 additions & 0 deletions app/views/pages/preview.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
= javascript_include_tag 'signup'

= content_for :title, "Find grant funding for #{@tag}"

- content_for :public do
Expand Down

0 comments on commit 50d4354

Please sign in to comment.