From 9e60048c8294e3a0c20f0462eb3e313bfec5e581 Mon Sep 17 00:00:00 2001 From: jomo Date: Mon, 23 Jun 2014 02:59:48 +0200 Subject: [PATCH] redirect logged in users to news, others to home --- app/controllers/statics_controller.rb | 8 ++++++++ config/routes.rb | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/statics_controller.rb b/app/controllers/statics_controller.rb index f211319..f2891f3 100644 --- a/app/controllers/statics_controller.rb +++ b/app/controllers/statics_controller.rb @@ -1,5 +1,13 @@ class StaticsController < ApplicationController + def index + if current_user + redirect_to blogposts_path + else + redirect_to home_statics_path + end + end + def home end diff --git a/config/routes.rb b/config/routes.rb index b02bde6..9ab4310 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -51,5 +51,5 @@ Redstoner::Application.routes.draw do # post 'paypal' => 'paypal#create' - root to: 'statics#home' + root to: 'statics#index' end \ No newline at end of file