Changeset 134
- Timestamp:
- 04/30/08 12:29:22 (8 months ago)
- Files:
-
- ambitiouslemon/branches/peter/.gitignore (copied) (copied from ambitiouslemon/trunk/.gitignore)
- ambitiouslemon/branches/peter/Capfile (copied) (copied from ambitiouslemon/trunk/Capfile)
- ambitiouslemon/branches/peter/app/controllers/abilities_controller.rb (copied) (copied from ambitiouslemon/trunk/app/controllers/abilities_controller.rb)
- ambitiouslemon/branches/peter/app/controllers/account_controller.rb (modified) (1 diff)
- ambitiouslemon/branches/peter/app/controllers/application.rb (modified) (1 diff)
- ambitiouslemon/branches/peter/app/controllers/skill_categories_controller.rb (copied) (copied from ambitiouslemon/trunk/app/controllers/skill_categories_controller.rb)
- ambitiouslemon/branches/peter/app/controllers/skills_controller.rb (copied) (copied from ambitiouslemon/trunk/app/controllers/skills_controller.rb)
- ambitiouslemon/branches/peter/app/helpers/abilities_helper.rb (copied) (copied from ambitiouslemon/trunk/app/helpers/abilities_helper.rb)
- ambitiouslemon/branches/peter/app/helpers/skill_categories_helper.rb (copied) (copied from ambitiouslemon/trunk/app/helpers/skill_categories_helper.rb)
- ambitiouslemon/branches/peter/app/helpers/skills_helper.rb (copied) (copied from ambitiouslemon/trunk/app/helpers/skills_helper.rb)
- ambitiouslemon/branches/peter/app/models/ability.rb (copied) (copied from ambitiouslemon/trunk/app/models/ability.rb)
- ambitiouslemon/branches/peter/app/models/skill.rb (modified) (1 diff)
- ambitiouslemon/branches/peter/app/models/skill_category.rb (copied) (copied from ambitiouslemon/trunk/app/models/skill_category.rb)
- ambitiouslemon/branches/peter/app/models/user.rb (modified) (1 diff)
- ambitiouslemon/branches/peter/app/views/abilities (copied) (copied from ambitiouslemon/trunk/app/views/abilities)
- ambitiouslemon/branches/peter/app/views/abilities/edit.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/abilities/edit.html.erb)
- ambitiouslemon/branches/peter/app/views/abilities/index.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/abilities/index.html.erb)
- ambitiouslemon/branches/peter/app/views/abilities/new.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/abilities/new.html.erb)
- ambitiouslemon/branches/peter/app/views/abilities/show.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/abilities/show.html.erb)
- ambitiouslemon/branches/peter/app/views/apply/edit.rhtml (modified) (1 diff)
- ambitiouslemon/branches/peter/app/views/apply/new.rhtml (modified) (1 diff)
- ambitiouslemon/branches/peter/app/views/apply/show.rhtml (modified) (2 diffs)
- ambitiouslemon/branches/peter/app/views/layouts/abilities.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/layouts/abilities.html.erb)
- ambitiouslemon/branches/peter/app/views/layouts/generic.rhtml (modified) (1 diff)
- ambitiouslemon/branches/peter/app/views/layouts/roles.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/layouts/roles.html.erb)
- ambitiouslemon/branches/peter/app/views/layouts/skill_categories.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/layouts/skill_categories.html.erb)
- ambitiouslemon/branches/peter/app/views/layouts/skills.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/layouts/skills.html.erb)
- ambitiouslemon/branches/peter/app/views/roles (copied) (copied from ambitiouslemon/trunk/app/views/roles)
- ambitiouslemon/branches/peter/app/views/roles/edit.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/roles/edit.html.erb)
- ambitiouslemon/branches/peter/app/views/roles/index.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/roles/index.html.erb)
- ambitiouslemon/branches/peter/app/views/roles/new.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/roles/new.html.erb)
- ambitiouslemon/branches/peter/app/views/roles/show.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/roles/show.html.erb)
- ambitiouslemon/branches/peter/app/views/sites/edit.rhtml (modified) (1 diff)
- ambitiouslemon/branches/peter/app/views/sites/new.rhtml (modified) (1 diff)
- ambitiouslemon/branches/peter/app/views/skill_categories (copied) (copied from ambitiouslemon/trunk/app/views/skill_categories)
- ambitiouslemon/branches/peter/app/views/skill_categories/edit.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/skill_categories/edit.html.erb)
- ambitiouslemon/branches/peter/app/views/skill_categories/index.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/skill_categories/index.html.erb)
- ambitiouslemon/branches/peter/app/views/skill_categories/new.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/skill_categories/new.html.erb)
- ambitiouslemon/branches/peter/app/views/skill_categories/show.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/skill_categories/show.html.erb)
- ambitiouslemon/branches/peter/app/views/skills (copied) (copied from ambitiouslemon/trunk/app/views/skills)
- ambitiouslemon/branches/peter/app/views/skills/edit.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/skills/edit.html.erb)
- ambitiouslemon/branches/peter/app/views/skills/index.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/skills/index.html.erb)
- ambitiouslemon/branches/peter/app/views/skills/new.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/skills/new.html.erb)
- ambitiouslemon/branches/peter/app/views/skills/show.html.erb (copied) (copied from ambitiouslemon/trunk/app/views/skills/show.html.erb)
- ambitiouslemon/branches/peter/app/views/users/_user_approve.rhtml (modified) (1 diff)
- ambitiouslemon/branches/peter/app/views/users/_user_list.rhtml (modified) (1 diff)
- ambitiouslemon/branches/peter/app/views/users/edit.rhtml (modified) (1 diff)
- ambitiouslemon/branches/peter/config (modified) (1 prop)
- ambitiouslemon/branches/peter/config/boot.rb (modified) (1 diff)
- ambitiouslemon/branches/peter/config/database.yml (copied) (copied from ambitiouslemon/trunk/config/database.yml)
- ambitiouslemon/branches/peter/config/deploy.rb (modified) (1 diff)
- ambitiouslemon/branches/peter/config/environment.rb (modified) (3 diffs)
- ambitiouslemon/branches/peter/config/environments/development.rb (modified) (1 diff)
- ambitiouslemon/branches/peter/config/environments/production.rb (modified) (1 diff)
- ambitiouslemon/branches/peter/config/environments/test.rb (modified) (1 diff)
- ambitiouslemon/branches/peter/config/initializers (copied) (copied from ambitiouslemon/trunk/config/initializers)
- ambitiouslemon/branches/peter/config/initializers/inflections.rb (copied) (copied from ambitiouslemon/trunk/config/initializers/inflections.rb)
- ambitiouslemon/branches/peter/config/initializers/mime_types.rb (copied) (copied from ambitiouslemon/trunk/config/initializers/mime_types.rb)
- ambitiouslemon/branches/peter/config/mongrel_cluster.yml (modified) (1 diff)
- ambitiouslemon/branches/peter/config/routes.rb (modified) (1 diff)
- ambitiouslemon/branches/peter/db/migrate/001_initial_schema.rb (modified) (2 diffs)
- ambitiouslemon/branches/peter/db/migrate/003_create_skill_categories.rb (copied) (copied from ambitiouslemon/trunk/db/migrate/003_create_skill_categories.rb)
- ambitiouslemon/branches/peter/db/migrate/004_create_skills.rb (copied) (copied from ambitiouslemon/trunk/db/migrate/004_create_skills.rb)
- ambitiouslemon/branches/peter/db/migrate/005_create_abilities.rb (copied) (copied from ambitiouslemon/trunk/db/migrate/005_create_abilities.rb)
- ambitiouslemon/branches/peter/db/schema.rb (modified) (1 diff)
- ambitiouslemon/branches/peter/doc/README_FOR_APP (modified) (1 diff)
- ambitiouslemon/branches/peter/lib/tasks/deprecated.rake (copied) (copied from ambitiouslemon/trunk/lib/tasks/deprecated.rake)
- ambitiouslemon/branches/peter/log/.gitignore (copied) (copied from ambitiouslemon/trunk/log/.gitignore)
- ambitiouslemon/branches/peter/public/422.html (copied) (copied from ambitiouslemon/trunk/public/422.html)
- ambitiouslemon/branches/peter/public/500.html (modified) (1 diff)
- ambitiouslemon/branches/peter/public/images/rails.png (copied) (copied from ambitiouslemon/trunk/public/images/rails.png)
- ambitiouslemon/branches/peter/public/index.html (copied) (copied from ambitiouslemon/trunk/public/index.html)
- ambitiouslemon/branches/peter/public/javascripts/controls.js (modified) (19 diffs)
- ambitiouslemon/branches/peter/public/javascripts/dragdrop.js (modified) (29 diffs)
- ambitiouslemon/branches/peter/public/javascripts/effects.js (modified) (50 diffs)
- ambitiouslemon/branches/peter/public/javascripts/prototype.js (modified) (84 diffs)
- ambitiouslemon/branches/peter/public/robots.txt (modified) (1 diff)
- ambitiouslemon/branches/peter/public/stylesheets/scaffold.css (modified) (1 diff)
- ambitiouslemon/branches/peter/script/performance/request (copied) (copied from ambitiouslemon/trunk/script/performance/request)
- ambitiouslemon/branches/peter/script/spin (copied) (copied from ambitiouslemon/trunk/script/spin)
- ambitiouslemon/branches/peter/test/fixtures/abilities.yml (copied) (copied from ambitiouslemon/trunk/test/fixtures/abilities.yml)
- ambitiouslemon/branches/peter/test/fixtures/skill_categories.yml (copied) (copied from ambitiouslemon/trunk/test/fixtures/skill_categories.yml)
- ambitiouslemon/branches/peter/test/fixtures/skills.yml (modified) (1 diff)
- ambitiouslemon/branches/peter/test/functional/abilities_controller_test.rb (copied) (copied from ambitiouslemon/trunk/test/functional/abilities_controller_test.rb)
- ambitiouslemon/branches/peter/test/functional/skill_categories_controller_test.rb (copied) (copied from ambitiouslemon/trunk/test/functional/skill_categories_controller_test.rb)
- ambitiouslemon/branches/peter/test/functional/skills_controller_test.rb (copied) (copied from ambitiouslemon/trunk/test/functional/skills_controller_test.rb)
- ambitiouslemon/branches/peter/test/test_helper.rb (modified) (2 diffs)
- ambitiouslemon/branches/peter/test/unit/ability_test.rb (copied) (copied from ambitiouslemon/trunk/test/unit/ability_test.rb)
- ambitiouslemon/branches/peter/test/unit/skill_category_test.rb (copied) (copied from ambitiouslemon/trunk/test/unit/skill_category_test.rb)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
ambitiouslemon/branches/peter/app/controllers/account_controller.rb
r39 r134 19 19 if params[:remember_me] == "1" 20 20 self.current_user.remember_me 21 cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at } 21 cookies[:auth_token] = { :value => self.current_user.remember_token , 22 :expires => self.current_user.remember_token_expires_at } 22 23 end 23 24 redirect_back_or_default( :action => 'index') ambitiouslemon/branches/peter/app/controllers/application.rb
r25 r134 3 3 4 4 class ApplicationController < ActionController::Base 5 # Pick a unique cookie name to distinguish our session data from others' 6 session :session_key => '_alcd_session_id' 5 helper :all # include all helpers, all the time 6 7 # See ActionController::RequestForgeryProtection for details 8 # Uncomment the :secret if you're not using the cookie session store 9 protect_from_forgery # :secret => 'a1110632f977a34cb503d5c35e5cfd79' 7 10 end ambitiouslemon/branches/peter/app/models/skill.rb
r23 r134 1 1 class Skill < ActiveRecord::Base 2 has_and_belongs_to_many :users 2 belongs_to :skill_category 3 has_many :abilities 4 has_many :users, :through => :abilities 3 5 end ambitiouslemon/branches/peter/app/models/user.rb
r38 r134 4 4 attr_accessor :password 5 5 6 7 has_many :abiilities 8 has_many :skills, :through => :abilities 6 9 has_and_belongs_to_many :roles 7 10 ambitiouslemon/branches/peter/app/views/apply/edit.rhtml
r22 r134 1 1 <h1>Editing Ambitious Lemon Application</h1> 2 2 3 <% = start_form_tag :action => 'update', :id => @answer%>3 <% form_for :apply, :action => 'update', :id => @answer do |f| %> 4 4 <%= render :partial => 'form' %> 5 5 <%= submit_tag 'Save' %> 6 <% = end_form_tag%>6 <% end %> ambitiouslemon/branches/peter/app/views/apply/new.rhtml
r22 r134 1 1 <h1>New Ambitious Lemon Application</h1> 2 2 3 <% = start_form_tag :action => 'create'%>3 <% form_for :apply, tag :action => 'create' do |f| %> 4 4 <%= render :partial => 'form' %> 5 5 <%= submit_tag "Create and Save" %> 6 <% = end_form_tag%>6 <% end %> ambitiouslemon/branches/peter/app/views/apply/show.rhtml
r22 r134 1 1 <h1>Ambitious Lemon Application</h1> 2 2 3 <% = start_form_tag :action => 'create'%>3 <% form_for :apply, :action => 'create' do |f| %> 4 4 5 5 <% counter = 0 %> … … 47 47 <br> 48 48 <%= submit_tag "Save" %> 49 <% = end_form_tag%>49 <% end %> ambitiouslemon/branches/peter/app/views/layouts/generic.rhtml
r39 r134 7 7 <title>AmbitiousLemon - Free Nonprofit Web Hosting</title> 8 8 <%= stylesheet_link_tag 'my' %> 9 <link rel="stylesheet" type="text/css" href="my.css" />10 9 <!--[if IE]> 11 10 <%= stylesheet_link_tag 'compatability' %> ambitiouslemon/branches/peter/app/views/sites/edit.rhtml
r22 r134 1 1 <h1>Editing <%= @site.url %></h1> 2 2 3 <% = start_form_tag :action => 'update', :id => @site%>3 <% form_for :site, @site :action => 'update', :id => @site do |f| %> 4 4 <%= render :partial => 'form' %> 5 5 <div style='text-align: center; padding: 10px;'> 6 6 <%= submit_tag 'Save' %> 7 7 </div> 8 <% = end_form_tag%>8 <% end %> ambitiouslemon/branches/peter/app/views/sites/new.rhtml
r22 r134 1 1 <h1>New Site</h1> 2 2 3 <% = start_form_tag :action => 'create'%>3 <% form_for :site, :action => 'create' do |f| %> 4 4 <%= render :partial => 'form' %> 5 5 <div style='text-align: center; padding: 10px;'> 6 6 <%= submit_tag 'Create' %> 7 7 </div> 8 <% = end_form_tag%>8 <% end %> ambitiouslemon/branches/peter/app/views/users/_user_approve.rhtml
r22 r134 29 29 <td><%= link_to 'Application', :action => 'observe', :controller => 'apply', :id => user %></td> 30 30 <td><%= link_to 'Activate', :action => 'activate', :id => user %></td> 31 <td><%= link_to 'Delete', { :action => 'destroy', :id => user }, :confirm => 'Are you sure?', : post => true%></td>31 <td><%= link_to 'Delete', { :action => 'destroy', :id => user }, :confirm => 'Are you sure?', :method => post %></td> 32 32 <% end %> 33 33 <% if counter == 0 %> ambitiouslemon/branches/peter/app/views/users/_user_list.rhtml
r22 r134 28 28 <td><%= link_to 'Show', :action => 'show', :id => user %></td> 29 29 <td><%= link_to 'Edit', :action => 'edit', :id => user %></td> 30 <td><%= link_to 'Deactivate', { :action => 'deactivate', :id => user}, :confirm => 'Are you sure?', : post => true%></td>31 <td><%= link_to 'Destroy', { :action => 'destroy', :id => user }, :confirm => 'You are about to DESTROY a user! This could muck up the database! Are you sure?', : post => true%></td>30 <td><%= link_to 'Deactivate', { :action => 'deactivate', :id => user}, :confirm => 'Are you sure?', :method => post %></td> 31 <td><%= link_to 'Destroy', { :action => 'destroy', :id => user }, :confirm => 'You are about to DESTROY a user! This could muck up the database! Are you sure?', :method => post %></td> 32 32 <% end %> 33 33 <% if counter == 0 %> ambitiouslemon/branches/peter/app/views/users/edit.rhtml
r22 r134 1 1 <h1>Editing User Profile</h1> 2 2 3 <% = start_form_tag :action => 'update', :id => @user%>3 <% form_for :user, @user, :action => 'update', :id => @user do |f|%> 4 4 <%= render :partial => 'form' %> 5 5 <div style='text-align: center; padding: 10px;'> 6 6 <%= submit_tag 'Save' %> 7 7 </div> 8 <% = end_form_tag%>8 <% end %> ambitiouslemon/branches/peter/config
- Property svn:ignore changed from
database.yml
to
- Property svn:ignore changed from
ambitiouslemon/branches/peter/config/boot.rb
r35 r134 1 # Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb 1 # Don't change this file! 2 # Configure your app in config/environment.rb and config/environments/*.rb 2 3 3 unless defined?(RAILS_ROOT) 4 root_path = File.join(File.dirname(__FILE__), '..') 4 RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT) 5 5 6 unless RUBY_PLATFORM =~ /(:?mswin|mingw)/ 7 require 'pathname' 8 root_path = Pathname.new(root_path).cleanpath(true).to_s 9 end 6 module Rails 7 class << self 8 def boot! 9 unless booted? 10 preinitialize 11 pick_boot.run 12 end 13 end 10 14 11 RAILS_ROOT = root_path 12 end 15 def booted? 16 defined? Rails::Initializer 17 end 13 18 14 unless defined?(Rails::Initializer) 15 if File.directory?("#{RAILS_ROOT}/vendor/rails") 16 require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer" 17 else 18 require 'rubygems' 19 def pick_boot 20 (vendor_rails? ? VendorBoot : GemBoot).new 21 end 19 22 20 environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join21 environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/22 rails_gem_version = $123 def vendor_rails? 24 File.exist?("#{RAILS_ROOT}/vendor/rails") 25 end 23 26 24 if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version 25 # Asking for 1.1.6 will give you 1.1.6.5206, if available -- makes it easier to use beta gems 26 rails_gem = Gem.cache.search('rails', "~>#{version}.0").sort_by { |g| g.version.version }.last 27 # FIXME : Ruby 1.9 28 def preinitialize 29 load(preinitializer_path) if File.exists?(preinitializer_path) 30 end 27 31 28 if rails_gem 29 gem "rails", "=#{rails_gem.version.version}" 30 require rails_gem.full_gem_path + '/lib/initializer' 31 else 32 STDERR.puts %(Cannot find gem for Rails ~>#{version}.0: 33 Install the missing gem with 'gem install -v=#{version} rails', or 34 change environment.rb to define RAILS_GEM_VERSION with your desired version. 35 ) 36 exit 1 37 end 38 else 39 gem "rails" 40 require 'initializer' 32 def preinitializer_path 33 "#{RAILS_ROOT}/config/preinitializer.rb" 41 34 end 42 35 end 43 36 44 Rails::Initializer.run(:set_load_path) 37 class Boot 38 def run 39 load_initializer 40 Rails::Initializer.run(:set_load_path) 41 end 42 end 43 44 class VendorBoot < Boot 45 def load_initializer 46 require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer" 47 end 48 end 49 50 class GemBoot < Boot 51 def load_initializer 52 self.class.load_rubygems 53 load_rails_gem 54 require 'initializer' 55 end 56 57 def load_rails_gem 58 if version = self.class.gem_version 59 gem 'rails', version 60 else 61 gem 'rails' 62 end 63 rescue Gem::LoadError => load_error 64 $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.) 65 exit 1 66 end 67 68 class << self 69 def rubygems_version 70 Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion 71 end 72 73 def gem_version 74 if defined? RAILS_GEM_VERSION 75 RAILS_GEM_VERSION 76 elsif ENV.include?('RAILS_GEM_VERSION') 77 ENV['RAILS_GEM_VERSION'] 78 else 79 parse_gem_version(read_environment_rb) 80 end 81 end 82 83 def load_rubygems 84 require 'rubygems' 85 86 unless rubygems_version >= '0.9.4' 87 $stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.) 88 exit 1 89 end 90 91 rescue LoadError 92 $stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org) 93 exit 1 94 end 95 96 def parse_gem_version(text) 97 $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/ 98 end 99 100 private 101 def read_environment_rb 102 File.read("#{RAILS_ROOT}/config/environment.rb") 103 end 104 end 105 end 45 106 end 107 108 # All that for this: 109 Rails.boot! ambitiouslemon/branches/peter/config/deploy.rb
r88 r134 40 40 # set :gateway, "gate.host.com" # default to no gateway 41 41 set :deploy_to, "/home/admin/myapp" 42 set :user, "admin" 42 set :user, "peter" 43 set :use_sudo, false 44 45 set :scm, :subversion 46 set :scm_username, "peter" 47 set :scm_password, "Passw0rd" 48 set :checkout, "export" 43 49 44 50 set :mongrel_conf, "#{current_path}/config/mongrel_cluster.yml" 45 51 52 set :runner, "peter" 46 53 47 54 # ============================================================================= ambitiouslemon/branches/peter/config/environment.rb
r35 r134 1 # Be sure to restart your web server when you modify this file.1 # Be sure to restart your server when you modify this file 2 2 3 # Uncomment below to force Rails into production mode when 3 # Uncomment below to force Rails into production mode when 4 4 # you don't control web/app server and can't set it the proper way 5 5 # ENV['RAILS_ENV'] ||= 'production' 6 6 7 7 # Specifies gem version of Rails to use when vendor/rails is not present 8 RAILS_GEM_VERSION = ' 1.2.3' #unless defined? RAILS_GEM_VERSION8 RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION 9 9 10 10 # Bootstrap the Rails environment, frameworks, and default configuration … … 12 12 13 13 Rails::Initializer.run do |config| 14 # Settings in config/environments/* take precedence over those specified here 15 16 # Skip frameworks you're not going to use (only works if using vendor/rails)17 # config.frameworks -= [ :action_web_service, :action_mailer ]14 # Settings in config/environments/* take precedence over those specified here. 15 # Application configuration should go into files in config/initializers 16 # -- all .rb files in that directory are automatically loaded. 17 # See Rails::Configuration for more options. 18 18 19 # Only load the plugins named here, by default all plugins in vendor/plugins are loaded 20 # config.plugins = %W( exception_notification ssl_requirement ) 19 # Skip frameworks you're not going to use (only works if using vendor/rails). 20 # To use Rails without a database, you must remove the Active Record framework 21 # config.frameworks -= [ :active_record, :active_resource, :action_mailer ] 22 23 # Only load the plugins named here, in the order given. By default, all plugins 24 # in vendor/plugins are loaded in alphabetical order. 25 # :all can be used as a placeholder for all plugins not explicitly named 26 # config.plugins = [ :exception_notification, :ssl_requirement, :all ] 21 27 22 28 # Add additional load paths for your own custom dirs 23 29 # config.load_paths += %W( #{RAILS_ROOT}/extras ) 24 30 25 # Force all environments to use the same logger level 31 # Force all environments to use the same logger level 26 32 # (by default production uses :info, the others :debug) 27 33 # config.log_level = :debug 28 34 29 # Use the database for sessions instead of the file system 35 # Your secret key for verifying cookie session data integrity. 36 # If you change this key, all old sessions will become invalid! 37 # Make sure the secret is at least 30 characters and all random, 38 # no regular words or you'll be exposed to dictionary attacks. 39 config.action_controller.session = { 40 :session_key => '_al_session', 41 :secret => '3f9020a15e2b63bc71d0d0b8c626ebccdce02579940c0abcdd2510fdb416bd912e16e61393e9e425b6af7e42158e0d9a436ce1dad451b967a9298c001124751f' 42 } 43 44 # Use the database for sessions instead of the cookie-based default, 45 # which shouldn't be used to store highly confidential information 30 46 # (create the session table with 'rake db:sessions:create') 31 47 # config.action_controller.session_store = :active_record_store 32 48 33 49 # Use SQL instead of Active Record's schema dumper when creating the test database. 34 # This is necessary if your schema can't be completely dumped by the schema dumper, 50 # This is necessary if your schema can't be completely dumped by the schema dumper, 35 51 # like if you have constraints or database-specific column types 36 52 # config.active_record.schema_format = :sql … … 41 57 # Make Active Record use UTC-base instead of local time 42 58 # config.active_record.default_timezone = :utc 43 44 # See Rails::Configuration for more options45 59 end 46 47 # Add new inflection rules using the following format48 # (all these examples are active by default):49 # Inflector.inflections do |inflect|50 # inflect.plural /^(ox)$/i, '\1en'51 # inflect.singular /^(ox)en/i, '\1'52 # inflect.irregular 'person', 'people'53 # inflect.uncountable %w( fish sheep )54 # end55 56 # Add new mime types for use in respond_to blocks:57 # Mime::Type.register "text/richtext", :rtf58 # Mime::Type.register "application/x-mobile", :mobile59 60 # Include your application configuration belowambitiouslemon/branches/peter/config/environments/development.rb
r22 r134 9 9 config.whiny_nils = true 10 10 11 # Enable the breakpoint server that script/breakpointer connects to12 config.breakpoint_server = true13 14 11 # Show full error reports and disable caching 15 12 config.action_controller.consider_all_requests_local = true 13 config.action_view.debug_rjs = true 16 14 config.action_controller.perform_caching = false 17 15 config.action_view.cache_template_extensions = false 18 config.action_view.debug_rjs = true19 16 20 17 # Don't care if the mailer can't send ambitiouslemon/branches/peter/config/environments/production.rb
r25 r134 11 11 config.action_controller.consider_all_requests_local = false 12 12 config.action_controller.perform_caching = true 13 config.action_view.cache_template_loading = true 13 14 14 15 # Enable serving of images, stylesheets, and javascripts from an asset server ambitiouslemon/branches/peter/config/environments/test.rb
r22 r134 14 14 config.action_controller.perform_caching = false 15 15 16 # Disable request forgery protection in test environment 17 config.action_controller.allow_forgery_protection = false 18 16 19 # Tell ActionMailer not to deliver emails to the real world. 17 20 # The :test delivery method accumulates sent emails in the ambitiouslemon/branches/peter/config/mongrel_cluster.yml
r88 r134 1 --- 2 user: admin3 cwd: /home/admin/myapp 1 --- 2 user: peter 3 cwd: /home/admin/myapp/current 4 4 port: "8000" 5 group: apache 6 #address: 127 5 environment: production 6 group: users 7 7 pid_file: log/mongrel.pid 8 8 servers: 2 ambitiouslemon/branches/peter/config/routes.rb
r25 r134 1 1 ActionController::Routing::Routes.draw do |map| 2 3 # map.root :controller => 'users' 4 # map.resources :users, :has_many => :abilities 5 map.resources :abilities 6 7 map.resources :skills 8 9 map.resources :skill_categories, :has_many => :skills 10 2 11 # The priority is based upon order of creation: first created -> highest priority. 3 12 4 13 # Sample of regular route: 5 # map.connect 'products/:id', :controller => 'catalog', :action => 'view'14 # map.connect 'products/:id', :controller => 'catalog', :action => 'view' 6 15 # Keep in mind you can assign values other than :controller and :action 7 16 8 17 # Sample of named route: 9 # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'18 # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase' 10 19 # This route can be invoked with purchase_url(:id => product.id) 11 20 12 # You can have the root of your site routed by hooking up '' 13 # -- just remember to delete public/index.html. 14 map.connect '', :controller => "sections", :action => 'index' 21 # Sample resource route (maps HTTP verbs to controller actions automatically): 22 # map.resources :products 15 23 16 # Allow downloading Web Service WSDL as a file with an extension 17 # instead of a file named 'wsdl' 18 map.connect ':controller/service.wsdl', :action => 'wsdl' 24 # Sample resource route with options: 25 # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get } 19 26 20 # Install the default route as the lowest priority. 27 # Sample resource route with sub-resources: 28 # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller 29 30 # Sample resource route within a namespace: 31 # map.namespace :admin do |admin| 32 # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb) 33 # admin.resources :products 34 # end 35 36 # You can have the root of your site routed with map.root -- just remember to delete public/index.html. 37 # map.root :controller => "welcome" 38 39 # See how all your routes lay out with "rake routes" 40 41 # Install the default routes as the lowest priority. 42 map.connect ':controller/:action/:id' 21 43 map.connect ':controller/:action/:id.:format' 22 map.connect ':controller/:action/:id'23 44 end ambitiouslemon/branches/peter/db/migrate/001_initial_schema.rb
r38 r134 40 40 41 41 #add_index "sites", ["id"], :name => "id", :unique => true 42 43 create_table "skillcategories", :force => true do |t| 44 t.column "catagory", :text, :default => "", :null => false 45 end 46 47 #add_index "skillcategories", ["id"], :name => "id", :unique => true 48 49 create_table "skills", :force => true do |t| 50 t.column "name", :text, :default => "", :null => false 51 t.column "cat", :integer, :default => 1, :null => false 52 end 53 54 #add_index "skills", ["id"], :name => "id", :unique => true 42 55 43 56 44 create_table "skills_users", :id => false, :force => true do |t| … … 97 85 drop_table :questions 98 86 drop_table :sites 99 drop_table :skillcategories100 drop_table :skills101 87 drop_table :skills_users 102 88 drop_table :users ambitiouslemon/branches/peter/db/schema.rb
r88 r134 1 # This file is auto generated. Instead of editing this file, please use the2 # migrations feature of ActiveRecord to incrementally modify your database, and1 # This file is auto-generated from the current state of the database. Instead of editing this file, 2 # please use the migrations feature of ActiveRecord to incrementally modify your database, and 3 3 # then regenerate this schema definition. 4 # 5 # Note that this schema.rb definition is the authoritative source for your database schema. If you need 6 # to create the application database on another system, you should be using db:schema:load, not running 7 # all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations 8 # you'll amass, the slower it'll run and the greater likelihood for issues). 9 # 10 # It's strongly recommended to check this file into your version control system. 4 11 5 ActiveRecord::Schema.define(:version => 2) do 12 ActiveRecord::Schema.define(:version => 5) do 13 14 create_table "abilities", :force => true do |t| 15 t.integer "skill_id" 16 t.integer "user_id" 17 t.text "details" 18 t.datetime "created_at" 19 t.datetime "updated_at" 20 end 6 21 7 22 create_table "answers", :force => true do |t| 8 t. column "question_id", :integer, :default => 0, :null => false9 t. column "user_id", :integer,:default => 0, :null => false10 t. column "answer", :text,:default => "", :null => false23 t.integer "question_id", :
