Skip to content

Instantly share code, notes, and snippets.

@cristibalan
Created October 21, 2008 16:54
Show Gist options
  • Save cristibalan/18348 to your computer and use it in GitHub Desktop.
Save cristibalan/18348 to your computer and use it in GitHub Desktop.
commit 59efeb32bef98a97000ffe81baec6c434ab32647
Author: Cristi Balan <evil@che.lu>
Date: Tue Oct 21 19:50:04 2008 +0300
unscrew teh app. <3 railsrumble organizers
diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb
index f99efaa..edeb94b 100644
--- a/app/controllers/conferences_controller.rb
+++ b/app/controllers/conferences_controller.rb
@@ -5,9 +5,12 @@ class ConferencesController < ApplicationController
make_resourceful do
actions :all
+ before :create, :update do
+ current_object.group = current_group
+ end
end
- def current_objects
- @current_objects ||= current_group.conferences.find(:all, :order => "date DESC")
- end
+ def current_model
+ current_group.conferences
+ end
end
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index 6149229..2c36679 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -1,4 +1,5 @@
class GroupsController < ApplicationController
+ before_filter :login_required, :only => [:new, :create]
layout :layout_check
def index
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index 54921b4..2d6a4e8 100644
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -3,6 +3,7 @@ class HomeController < ApplicationController
def index
redirect_to conferences_path if current_group
+ @groups = Group.find(:all)
end
def show
diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml
index de1968d..ee0d73c 100644
--- a/app/views/home/index.html.haml
+++ b/app/views/home/index.html.haml
@@ -5,6 +5,7 @@
- content_for :sidebar do
= link_to 'Create your group', new_group_path
+ %ol= render :partial => 'groups/group', :collection => @groups
= content_for :extra_content do
#features
%h2 Features
diff --git a/config/environment.rb b/config/environment.rb
index 2fe3dc6..4ac59c7 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -47,6 +47,7 @@ Rails::Initializer.run do |config|
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
config.action_controller.session = {
+ :session_domain => '.wurbe.r08.railsrumble.com',
:session_key => '_bort_session',
:secret => 'c9ba017060e99fd4e23621a963dfe5d05e7975c732e622924b4a9b86a6b6d60ca6c067429f937c06675480f3181fc39f0d5328a73b559c3879cc2d9bee662c9d'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment