Skip to content
Browse files

redirect to teaser as a before_filter

  • Loading branch information...
1 parent 9169f91 commit 05a4ed77132113d867d199433ab6f594f19ecd93 @mccolin committed Mar 25, 2012
Showing with 18 additions and 1 deletion.
  1. +15 −0 app/controllers/application_controller.rb
  2. +3 −1 app/controllers/home_controller.rb
View
15 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
View
4 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

0 comments on commit 05a4ed7

Please sign in to comment.
Something went wrong with that request. Please try again.