This commit is contained in:
Jason Denney
2012-12-04 00:46:15 -05:00
commit aa3ed3d43b
97 changed files with 2398 additions and 0 deletions
@@ -0,0 +1,3 @@
class ApplicationController < ActionController::Base
protect_from_forgery
end
@@ -0,0 +1,3 @@
class AuthenticatedController < ApplicationController
before_filter :authenticate_user!
end
+9
View File
@@ -0,0 +1,9 @@
class SiteController < ApplicationController
def index
respond_to do |format|
format.html
end
end
end
+36
View File
@@ -0,0 +1,36 @@
class TeamsController < AuthenticatedController
expose(:team) do
if params[:id]
Team.find(params[:id])
elsif params[:team]
Team.new(params[:team])
else
Team.new(:max_members => 16)
end
end
expose(:teams) { Team.order('lower(name)').paginate(:page => params[:page]) }
def index
end
def show
end
def new
end
def create
team.captain = current_user
if team.save
redirect_to teams_url
else
render :new
end
end
def join
current_user.teams << team
redirect_to team
end
end