Created
December 16, 2011 17:18
-
-
Save andrewhl/1486962 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# After trying to visit /users/hellhuman: | |
Couldn't find User with id=hellhuman |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Asr::Application.routes.draw do | |
ActiveAdmin.routes(self) | |
devise_for :admin_users, ActiveAdmin::Devise.config | |
devise_for :users | |
resources :pages | |
resources :users | |
resources :admin | |
resources :manage | |
match '/manage', :to => 'manage#index' | |
match '/update', :to => 'manage#update' | |
match '/contact', :to => 'pages#contact' | |
match '/home', :to => 'pages#home' | |
match '/about', :to => 'pages#about' | |
match '/league', :to => 'pages#league' | |
match '/results', :to => 'pages#results' | |
match '/prizes', :to => 'pages#prizes' | |
match '/news', :to => 'pages#news' | |
match '/users', :to => 'users#index' | |
match '/:kgs_names', :to => 'users#show' | |
root :to => "pages#home" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= @user.username %>, <%= @user.email %> | |
<% if user_signed_in? %> | |
<p>Welcome!</p> | |
<table> | |
<tr> | |
<th>Black Player</th> | |
<th>White Player</th> | |
<th>Result</th> | |
</tr> | |
<% @games.each do |game| %> | |
<tr> | |
<td><%= game.black_player_name %></td> | |
<td><%= game.white_player_name %></td> | |
<td><%= game.result %></td> | |
</tr> | |
<% end %> | |
</table> | |
<% else %> | |
<p>You're not signed in!</p> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def show | |
@user = User.find(params[:id]) | |
@games = Match.where("white_player_name = ? or black_player_name = ?", @user.kgs_names, @user.kgs_names) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment