Skip to content

Commit

Permalink
homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
hexinpeter committed Aug 15, 2015
1 parent af3d876 commit 8b1a8e7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
3 changes: 2 additions & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ class UsersController < ApplicationController
before_filter :authenticate_user!

def index
@users = User.all
redirect_to new_user_session_path if !user_signed_in?
@user = current_user
end

def show
Expand Down
15 changes: 3 additions & 12 deletions app/views/users/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
<div class="container">
<div class="row">
<h3>Users</h3>
<div class="column">
<table class="table">
<tbody>
<% @users.each do |user| %>
<tr>
<%= render user %>
</tr>
<% end %>
</tbody>
</table>
</div>
<h3>I want to ...</h3>
<a><button type="button" class="btn btn-default btn-lg">Order</button></a>
<a><button type="button" class="btn btn-default btn-lg">Deliver</button></a>
</div>
</div>
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Rails.application.routes.draw do
root to: 'visitors#index'
root to: 'users#index'
devise_for :users
resources :users
end

0 comments on commit 8b1a8e7

Please sign in to comment.