Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Skip home page if already logged in

  • Loading branch information...
commit 46af8592da77d7d29cba8def0664c9d09d1f058e 1 parent 80e87a1
Ryan Daigle authored October 09, 2012
9  app/controllers/homes_controller.rb
... ...
@@ -1,2 +1,11 @@
1 1
 class HomesController < ApplicationController
  2
+
  3
+  before_filter :skip_if_logged_in, :only => :index
  4
+
  5
+  private
  6
+
  7
+  def skip_if_logged_in
  8
+    redirect_to search_gists_path if user_logged_in?
  9
+  end
  10
+
2 11
 end
6  app/views/homes/index.html.haml
... ...
@@ -1,6 +1,4 @@
1 1
 %h4 Hi there
2  
-%p Gisted lets you quickly get to your gists via search. You will need to log into GitHub via OAuth first.
  2
+%p Gisted lets you quickly search and access your gists. You will need to log into GitHub via OAuth first.
3 3
 
4  
-%p= link_to "Search my gists", search_gists_path
5  
-%p= link_to "Login", login_path
6  
-%p= link_to "Logout", logout_path
  4
+%p= link_to "Login & search my gists", search_gists_path

0 notes on commit 46af859

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