Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of git://github.com/mzslater/learning-rails-sam…

…ple-app
  • Loading branch information...
commit 15e96975904fe7c0fc4c5fccad7c8ac4d0ac3a5d 2 parents 6ccbac0 + c604ac8
chaupt authored
View
3  Capfile
@@ -0,0 +1,3 @@
+load 'deploy' if respond_to?(:namespace) # cap2 differentiator
+Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
+load 'config/deploy'
View
8 config/database.yml
@@ -14,6 +14,8 @@ test:
timeout: 5000
production:
- adapter: sqlite3
- database: db/production.sqlite3
- timeout: 5000
+ adapter: mysql
+ database: learningrails_production
+ username: deploy
+ password: secret
+ host: localhost
View
25 config/deploy.rb
@@ -0,0 +1,25 @@
+set :application, "learningrails"
+
+set :deploy_to, "/var/www/apps/#{application}"
+
+role :app, "sampleapp.learningrails.com"
+role :web, "sampleapp.learningrails.com"
+role :db, "sampleapp.learningrails.com", :primary => true
+
+default_run_options[:pty] = true
+set :repository, "git://github.com/mzslater/learning-rails-sample-app.git"
+set :scm, "git"
+set :user, "deploy"
+set :branch, "master"
+set :deploy_via, :remote_cache
+
+namespace :deploy do
+ desc "Restart Application"
+ task :restart, :roles => :app do
+ run "touch #{current_path}/tmp/restart.txt"
+ end
+ desc "Start Application -- not needed for Passenger"
+ task :start, :roles => :app do
+ # nothing -- need to override default cap start task when using Passenger
+ end
+end
View
54 db/migrate/011_default_pages.rb
@@ -0,0 +1,54 @@
+class DefaultPages < ActiveRecord::Migration
+ def self.up
+ if Page.find(:all).empty?
+ Page.create(:name => 'home', :title => 'Learning Rails Sample Application Home', :navlabel => 'Home', :position => 1,
+ :admin => false, :redirect => false,
+ :body => 'h1. Welcome to the Learning Rails Sample Application')
+ about_page = Page.create(:name => 'about', :title => 'About the Learning Rails Sample Application', :navlabel => 'About', :position => 2,
+ :admin => false, :redirect => false,
+ :body => 'h1. About This Application
+
+ p. This is the sample application for the "Learning Rails" free online course.
+ For more information, see "LearningRails.com":http://learningrails.com')
+ Page.create(:name => 'resources', :title => 'Learning Rails Resources', :navlabel => 'Resources', :position => 3,
+ :admin => false, :redirect => true,
+ :action_name => 'list', :controller_name => 'links')
+ Page.create(:name => 'contact', :title => 'Contact Us', :navlabel => 'Contact', :position => 4,
+ :admin => false, :redirect => true,
+ :action_name => 'new', :controller_name => 'messages')
+ Page.create(:name => 'admin', :title => 'Sample App Administration', :navlabel => 'Admin', :position => 9,
+ :admin => true, :redirect => false,
+ :body => 'h1. Admin Dashboard
+
+ p. "Page Admin":/pages
+
+ p. "User Admin":/users
+
+ p. "Category Admin":/categories
+
+ p. "Link Admin":/links
+
+ p. "Message Admin":/messages')
+ Page.create(:name => 'services', :title => 'Services', :navlabel => 'Services', :position => 1,
+ :admin => false, :redirect => false, :parent => about_page,
+ :body => 'h1. Services
+
+ p. This page is here just to illustrate a subpage')
+ Page.create(:name => 'products', :title => 'Products', :navlabel => 'Products', :position => 2,
+ :admin => false, :redirect => false, :parent => about_page,
+ :body => 'h1. Products
+
+ p. This page is here just to illustrate a subpage')
+ end
+ if Category.find(:all).empty?
+ rails_resources = Category.create(:title => 'Rails Resources', :description => 'Resources for Rails Developers')
+ html_resources = Category.create(:title => 'HTML Resources', :description => 'Basic HTML Resources')
+ Link.create(:url => 'http://www.buildingwebapps.com', :title => 'BuildingWebApps.com', :description => 'Resource site for
+ web application developers, created by the authors of the Learning Rails course').categories << rails_resources
+ Link.create(:url => 'http://w3c.org', :title => 'W3C', :description => 'Official standards body for the web').categories << html_resources
+ end
+ end
+
+ def self.down
+ end
+end
View
2  db/schema.rb
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 10) do
+ActiveRecord::Schema.define(:version => 11) do
create_table "categories", :force => true do |t|
t.string "title"
Please sign in to comment.
Something went wrong with that request. Please try again.