Permalink
Browse files

clearing out master branch to prepare for Rails 3 app

  • Loading branch information...
1 parent b074b52 commit df979ccf56299714d802016307a6c0781dd09851 @ryanb committed Feb 15, 2011
Showing with 0 additions and 8,394 deletions.
  1. +0 −3 .gitignore
  2. +0 −1 .rvmrc
  3. +0 −20 LICENSE
  4. +0 −12 README.rdoc
  5. +0 −10 Rakefile
  6. +0 −15 app/controllers/application_controller.rb
  7. +0 −44 app/controllers/projects_controller.rb
  8. +0 −20 app/helpers/application_helper.rb
  9. +0 −23 app/helpers/layout_helper.rb
  10. +0 −2 app/helpers/projects_helper.rb
  11. +0 −5 app/models/project.rb
  12. +0 −4 app/models/task.rb
  13. +0 −23 app/views/layouts/application.html.erb
  14. +0 −14 app/views/projects/_form.html.erb
  15. +0 −8 app/views/projects/_task.html.erb
  16. +0 −8 app/views/projects/edit.html.erb
  17. +0 −17 app/views/projects/index.html.erb
  18. +0 −5 app/views/projects/new.html.erb
  19. +0 −20 app/views/projects/show.html.erb
  20. +0 −110 config/boot.rb
  21. +0 −19 config/database.yml
  22. +0 −54 config/environment.rb
  23. +0 −17 config/environments/development.rb
  24. +0 −28 config/environments/production.rb
  25. +0 −28 config/environments/test.rb
  26. +0 −10 config/initializers/inflections.rb
  27. +0 −5 config/initializers/mime_types.rb
  28. +0 −15 config/initializers/new_rails_defaults.rb
  29. +0 −4 config/routes.rb
  30. +0 −12 db/migrate/20080718205616_create_projects.rb
  31. +0 −14 db/migrate/20080718205908_create_tasks.rb
  32. +0 −28 db/schema.rb
  33. +0 −2 doc/README_FOR_APP
  34. +0 −30 public/404.html
  35. +0 −30 public/422.html
  36. +0 −30 public/500.html
  37. +0 −10 public/dispatch.cgi
  38. +0 −24 public/dispatch.fcgi
  39. +0 −10 public/dispatch.rb
  40. 0 public/favicon.ico
  41. BIN public/images/rails.png
  42. +0 −17 public/javascripts/application.js
  43. +0 −963 public/javascripts/controls.js
  44. +0 −973 public/javascripts/dragdrop.js
  45. +0 −1,128 public/javascripts/effects.js
  46. +0 −4,320 public/javascripts/prototype.js
  47. +0 −5 public/robots.txt
  48. +0 −89 public/stylesheets/application.css
  49. +0 −3 script/about
  50. +0 −3 script/console
  51. +0 −3 script/dbconsole
  52. +0 −3 script/destroy
  53. +0 −3 script/generate
  54. +0 −3 script/performance/benchmarker
  55. +0 −3 script/performance/profiler
  56. +0 −3 script/performance/request
  57. +0 −3 script/plugin
  58. +0 −3 script/process/inspector
  59. +0 −3 script/process/reaper
  60. +0 −3 script/process/spawner
  61. +0 −3 script/runner
  62. +0 −3 script/server
  63. +0 −5 test/fixtures/projects.yml
  64. +0 −9 test/fixtures/tasks.yml
  65. +0 −54 test/functional/projects_controller_test.rb
  66. +0 −39 test/test_helper.rb
  67. +0 −8 test/unit/project_test.rb
  68. +0 −8 test/unit/task_test.rb
View
@@ -1,3 +0,0 @@
-log/*
-tmp/*
-*.sqlite3
View
@@ -1 +0,0 @@
-rvm use 1.8.7@complex-form-examples --create
View
@@ -1,20 +0,0 @@
-Copyright (c) 2008 Ryan Bates
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -1,12 +0,0 @@
-= Complex Form Examples
-
-This master branch is a simple solution for the multi-model form problem using the latest +accepts_nested_attributes_for+ available in Rails 2.3.
-
-Once you clone this repository, just run the migrations and start up the server to try it out.
-
- rake db:migrate
- script/server
-
-See the branches for alternative solutions. Here's how to clone a remote branch.
-
- git checkout -b deep origin/deep
View
@@ -1,10 +0,0 @@
-# Add your own tasks in files placed in lib/tasks ending in .rake,
-# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
-
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
-
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-require 'tasks/rails'
@@ -1,15 +0,0 @@
-# Filters added to this controller apply to all controllers in the application.
-# Likewise, all the methods added will be available for all controllers.
-
-class ApplicationController < ActionController::Base
- helper :all # include all helpers, all the time
-
- # See ActionController::RequestForgeryProtection for details
- # Uncomment the :secret if you're not using the cookie session store
- protect_from_forgery # :secret => '942733c28af903e7eb303ba250f52f1b'
-
- # See ActionController::Base for details
- # Uncomment this to filter the contents of submitted sensitive data parameters
- # from your application log (in this case, all fields with names like "password").
- # filter_parameter_logging :password
-end
@@ -1,44 +0,0 @@
-class ProjectsController < ApplicationController
- def index
- @projects = Project.find(:all)
- end
-
- def show
- @project = Project.find(params[:id])
- end
-
- def new
- @project = Project.new
- end
-
- def create
- @project = Project.new(params[:project])
- if @project.save
- flash[:notice] = "Successfully created project."
- redirect_to @project
- else
- render :action => 'new'
- end
- end
-
- def edit
- @project = Project.find(params[:id])
- end
-
- def update
- @project = Project.find(params[:id])
- if @project.update_attributes(params[:project])
- flash[:notice] = "Successfully updated project."
- redirect_to @project
- else
- render :action => 'edit'
- end
- end
-
- def destroy
- @project = Project.find(params[:id])
- @project.destroy
- flash[:notice] = "Successfully destroyed project."
- redirect_to projects_url
- end
-end
@@ -1,20 +0,0 @@
-# Methods added to this helper will be available to all templates in the application.
-module ApplicationHelper
- def remove_child_link(name, f)
- f.hidden_field(:_destroy) + link_to_function(name, "if (confirm('Really?')) remove_fields(this)")
- end
-
- def add_child_link(name, f, method)
- fields = new_child_fields(f, method)
- link_to_function(name, h("insert_fields(this, \"#{method}\", \"#{escape_javascript(fields)}\")"))
- end
-
- def new_child_fields(form_builder, method, options = {})
- options[:object] ||= form_builder.object.class.reflect_on_association(method).klass.new
- options[:partial] ||= method.to_s.singularize
- options[:form_builder_local] ||= :f
- form_builder.fields_for(method, options[:object], :child_index => "new_#{method}") do |f|
- render(:partial => options[:partial], :locals => { options[:form_builder_local] => f })
- end
- end
-end
@@ -1,23 +0,0 @@
-# These helper methods can be called in your template to set variables to be used in the layout
-# This module should be included in all views globally,
-# to do so you may need to add this line to your ApplicationController
-# helper :layout
-module LayoutHelper
- def title(page_title, show_title = true)
- @content_for_title = page_title.to_s
- @show_title = show_title
- end
-
- def show_title?
- @show_title
- end
-
- def stylesheet(*args)
- content_for(:head) { stylesheet_link_tag(*args.map(&:to_s)) }
- end
-
- def javascript(*args)
- args = args.map { |arg| arg == :defaults ? arg : arg.to_s }
- content_for(:head) { javascript_include_tag(*args) }
- end
-end
@@ -1,2 +0,0 @@
-module ProjectsHelper
-end
@@ -1,5 +0,0 @@
-class Project < ActiveRecord::Base
- has_many :tasks, :dependent => :destroy
- validates_presence_of :name
- accepts_nested_attributes_for :tasks, :reject_if => lambda { |a| a.values.all?(&:blank?) }, :allow_destroy => true
-end
View
@@ -1,4 +0,0 @@
-class Task < ActiveRecord::Base
- belongs_to :project
- validates_presence_of :name
-end
@@ -1,23 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
- <head>
- <title><%= h(yield(:title) || "Untitled") %></title>
- <%= stylesheet_link_tag 'application' %>
- <%= javascript_include_tag :defaults %>
- <%= yield(:head) %>
- </head>
- <body>
- <div id="container">
- <%- flash.each do |name, msg| -%>
- <%= content_tag :div, msg, :id => "flash_#{name}" %>
- <%- end -%>
-
- <%- if show_title? -%>
- <h1><%=h yield(:title) %></h1>
- <%- end -%>
-
- <%= yield %>
- </div>
- </body>
-</html>
@@ -1,14 +0,0 @@
-<% form_for @project do |f| %>
- <%= f.error_messages %>
- <p>
- <%= f.label :name %><br />
- <%= f.text_field :name %>
- </p>
-
- <h3>Tasks</h3>
- <% f.fields_for :tasks do |task_form| %>
- <%= render :partial => 'task', :locals => { :f => task_form } %>
- <% end %>
- <p><%= add_child_link "New Task", f, :tasks %></p>
- <p><%= f.submit "Submit" %></p>
-<% end %>
@@ -1,8 +0,0 @@
-<div class="fields">
- <%= f.label :name, "Task" %>
- <%= f.text_field :name %>
- <%= remove_child_link "remove", f %>
- <%# Alternatively you can use a check box: %>
- <%#= f.check_box :_destroy %>
- <%#= f.label :_destroy, "(remove)" %>
-</div>
@@ -1,8 +0,0 @@
-<% title "Edit Project" %>
-
-<%= render :partial => 'form' %>
-
-<p>
- <%= link_to "Show", @project %> |
- <%= link_to "View All", projects_path %>
-</p>
@@ -1,17 +0,0 @@
-<% title "Projects" %>
-
-<table>
- <tr>
- <th>Name</th>
- </tr>
- <% for project in @projects %>
- <tr>
- <td><%=h project.name %></td>
- <td><%= link_to "Show", project %></td>
- <td><%= link_to "Edit", edit_project_path(project) %></td>
- <td><%= link_to "Destroy", project, :confirm => 'Are you sure?', :method => :delete %></td>
- </tr>
- <% end %>
-</table>
-
-<p><%= link_to "New Project", new_project_path %></p>
@@ -1,5 +0,0 @@
-<% title "New Project" %>
-
-<%= render :partial => 'form' %>
-
-<p><%= link_to "Back to List", projects_path %></p>
@@ -1,20 +0,0 @@
-<% title "Project" %>
-
-<p>
- <strong>Name:</strong>
- <%=h @project.name %>
-</p>
-
-<h3>Tasks</h3>
-
-<ul>
- <% for task in @project.tasks %>
- <li><%=h task.name %></li>
- <% end %>
-</ul>
-
-<p>
- <%= link_to "Edit", edit_project_path(@project) %> |
- <%= link_to "Destroy", @project, :confirm => 'Are you sure?', :method => :delete %> |
- <%= link_to "View All", projects_path %>
-</p>
View
@@ -1,110 +0,0 @@
-# Don't change this file!
-# Configure your app in config/environment.rb and config/environments/*.rb
-
-RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
-
-module Rails
- class << self
- def boot!
- unless booted?
- preinitialize
- pick_boot.run
- end
- end
-
- def booted?
- defined? Rails::Initializer
- end
-
- def pick_boot
- (vendor_rails? ? VendorBoot : GemBoot).new
- end
-
- def vendor_rails?
- File.exist?("#{RAILS_ROOT}/vendor/rails")
- end
-
- def preinitialize
- load(preinitializer_path) if File.exist?(preinitializer_path)
- end
-
- def preinitializer_path
- "#{RAILS_ROOT}/config/preinitializer.rb"
- end
- end
-
- class Boot
- def run
- load_initializer
- Rails::Initializer.run(:set_load_path)
- end
- end
-
- class VendorBoot < Boot
- def load_initializer
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
- Rails::Initializer.run(:install_gem_spec_stubs)
- Rails::GemDependency.add_frozen_gem_path
- end
- end
-
- class GemBoot < Boot
- def load_initializer
- self.class.load_rubygems
- load_rails_gem
- require 'initializer'
- end
-
- def load_rails_gem
- if version = self.class.gem_version
- gem 'rails', version
- else
- gem 'rails'
- end
- rescue Gem::LoadError => load_error
- $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.)
- exit 1
- end
-
- class << self
- def rubygems_version
- Gem::RubyGemsVersion rescue nil
- end
-
- def gem_version
- if defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION
- elsif ENV.include?('RAILS_GEM_VERSION')
- ENV['RAILS_GEM_VERSION']
- else
- parse_gem_version(read_environment_rb)
- end
- end
-
- def load_rubygems
- min_version = '1.3.2'
- require 'rubygems'
- unless rubygems_version >= min_version
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
- exit 1
- end
-
- rescue LoadError
- $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
- exit 1
- end
-
- def parse_gem_version(text)
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
- end
-
- private
- def read_environment_rb
- File.read("#{RAILS_ROOT}/config/environment.rb")
- end
- end
- end
-end
-
-# All that for this:
-Rails.boot!
Oops, something went wrong.

0 comments on commit df979cc

Please sign in to comment.