Skip to content

Commit

Permalink
redirect to teaser as a before_filter
Browse files Browse the repository at this point in the history
  • Loading branch information
mccolin committed Mar 25, 2012
1 parent 9169f91 commit 05a4ed7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 15 additions & 0 deletions app/controllers/application_controller.rb
@@ -1,3 +1,18 @@
class ApplicationController < ActionController::Base
protect_from_forgery

before_filter :redirect_to_teaser


private

# Prior to site availability, redirect users in production env to teaser:
def redirect_to_teaser
if Rails.env.production?
logger.info "Redirecting user to WOSoMP Teaser"
render :file=>File.join(Rails.root,"public/teaser.html"), :layout=>nil
return
end
end

end
4 changes: 3 additions & 1 deletion app/controllers/home_controller.rb
@@ -1,7 +1,9 @@
# WOSOMP
# HomeController -- User interactions

class HomeController < ApplicationController

def index
render :file=>File.join(Rails.root,"public/teaser.html"), :layout=>nil and return if Rails.env.production?
render :text=>"Hello WOSoMP"
end

Expand Down

0 comments on commit 05a4ed7

Please sign in to comment.