Skip to content

Commit

Permalink
add article#index
Browse files Browse the repository at this point in the history
  • Loading branch information
igaiga committed Aug 25, 2012
1 parent 4830bab commit 8fb6db5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 247 deletions.
6 changes: 6 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
class ApplicationController < ActionController::Base
protect_from_forgery
helper_method :current_user

private
def current_user
@current_user ||= User.find(session[:user_id]) if session[:user_id]
end
end
2 changes: 2 additions & 0 deletions app/controllers/article_controller.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
class ArticleController < ApplicationController
def index
end
end
1 change: 1 addition & 0 deletions app/views/article/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Main page.
5 changes: 0 additions & 5 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
</head>
<body>

<div id="user_nav">
<%#= link_to "Sign in with Twitter", "/auth/twitter" %>
<%= link_to "Sign in with Facebook", "/auth/facebook" %>
</div>

<div id="user_nav">
<% if current_user %>
Welcome, <%= current_user.name %>! <%= link_to "Sign Out", signout_path %>
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OmniauthSample::Application.routes.draw do
#root :to => "articles#index"
root :to => "article#index"
match "/auth/:provider/callback" => "sessions#create"
match "/signout" => "sessions#destroy", :as => :signout
end
241 changes: 0 additions & 241 deletions public/index.html

This file was deleted.

0 comments on commit 8fb6db5

Please sign in to comment.