From d40ceb75e5f22ae2d7654b77d6201d2c6ec132d6 Mon Sep 17 00:00:00 2001 From: Alex Loddengaard Date: Thu, 18 Oct 2012 10:38:15 -0700 Subject: [PATCH] Setting the app up for Heroku. * Adding the proper gems, including Dalli and MemCachier. * Creating a simple view and controller. --- .gitignore | 2 + Gemfile | 33 +--- Gemfile.lock | 8 +- app/controllers/main_controller.rb | 4 + app/views/main/index.html.erb | 1 + config/database.yml | 25 --- config/routes.rb | 57 +------ public/index.html | 241 ----------------------------- 8 files changed, 18 insertions(+), 353 deletions(-) create mode 100644 app/controllers/main_controller.rb create mode 100644 app/views/main/index.html.erb delete mode 100644 config/database.yml delete mode 100644 public/index.html diff --git a/.gitignore b/.gitignore index eb3489a..fc42797 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ # Ignore all logfiles and tempfiles. /log/*.log /tmp + +config/database.yml diff --git a/Gemfile b/Gemfile index 45ffe90..4a23cb8 100644 --- a/Gemfile +++ b/Gemfile @@ -1,38 +1,13 @@ source 'https://rubygems.org' gem 'rails', '3.2.5' +gem 'jquery-rails' +gem 'pg' +gem 'dalli', '>=2.3.0' +gem 'memcachier' -# Bundle edge Rails instead: -# gem 'rails', :git => 'git://github.com/rails/rails.git' - -gem 'sqlite3' - - -# Gems used only for assets and not required -# in production environments by default. group :assets do gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3.2.1' - - # See https://github.com/sstephenson/execjs#readme for more supported runtimes - # gem 'therubyracer', :platforms => :ruby - gem 'uglifier', '>= 1.0.3' end - -gem 'jquery-rails' - -# To use ActiveModel has_secure_password -# gem 'bcrypt-ruby', '~> 3.0.0' - -# To use Jbuilder templates for JSON -# gem 'jbuilder' - -# Use unicorn as the app server -# gem 'unicorn' - -# Deploy with Capistrano -# gem 'capistrano' - -# To use debugger -# gem 'debugger' diff --git a/Gemfile.lock b/Gemfile.lock index c371bd6..1cdae5c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -37,6 +37,7 @@ GEM coffee-script-source execjs coffee-script-source (1.3.3) + dalli (2.3.0) erubis (2.7.0) execjs (1.4.0) multi_json (~> 1.0) @@ -51,8 +52,10 @@ GEM i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) + memcachier (0.0.1) mime-types (1.19) multi_json (1.3.6) + pg (0.13.2) polyglot (0.3.3) rack (1.4.1) rack-cache (1.2) @@ -88,7 +91,6 @@ GEM hike (~> 1.2) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.6) thor (0.16.0) tilt (1.3.3) treetop (1.4.11) @@ -104,8 +106,10 @@ PLATFORMS DEPENDENCIES coffee-rails (~> 3.2.1) + dalli (>= 2.3.0) jquery-rails + memcachier + pg rails (= 3.2.5) sass-rails (~> 3.2.3) - sqlite3 uglifier (>= 1.0.3) diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb new file mode 100644 index 0000000..88181c2 --- /dev/null +++ b/app/controllers/main_controller.rb @@ -0,0 +1,4 @@ +class MainController < ApplicationController + def index + end +end diff --git a/app/views/main/index.html.erb b/app/views/main/index.html.erb new file mode 100644 index 0000000..bd7fab7 --- /dev/null +++ b/app/views/main/index.html.erb @@ -0,0 +1 @@ +Nothing to see here. \ No newline at end of file diff --git a/config/database.yml b/config/database.yml deleted file mode 100644 index 51a4dd4..0000000 --- a/config/database.yml +++ /dev/null @@ -1,25 +0,0 @@ -# SQLite version 3.x -# gem install sqlite3 -# -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem 'sqlite3' -development: - adapter: sqlite3 - database: db/development.sqlite3 - pool: 5 - timeout: 5000 - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: - adapter: sqlite3 - database: db/test.sqlite3 - pool: 5 - timeout: 5000 - -production: - adapter: sqlite3 - database: db/production.sqlite3 - pool: 5 - timeout: 5000 diff --git a/config/routes.rb b/config/routes.rb index ac05b4e..3a50b49 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,58 +1,3 @@ RailsSandbox::Application.routes.draw do - # The priority is based upon order of creation: - # first created -> highest priority. - - # Sample of regular route: - # match 'products/:id' => 'catalog#view' - # Keep in mind you can assign values other than :controller and :action - - # Sample of named route: - # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase - # This route can be invoked with purchase_url(:id => product.id) - - # Sample resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Sample resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Sample resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Sample resource route with more complex sub-resources - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', :on => :collection - # end - # end - - # Sample resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end - - # You can have the root of your site routed with "root" - # just remember to delete public/index.html. - # root :to => 'welcome#index' - - # See how all your routes lay out with "rake routes" - - # This is a legacy wild controller route that's not recommended for RESTful applications. - # Note: This route will make all actions in every controller accessible via GET requests. - # match ':controller(/:action(/:id))(.:format)' + root :to => 'main#index' end diff --git a/public/index.html b/public/index.html deleted file mode 100644 index a1d5099..0000000 --- a/public/index.html +++ /dev/null @@ -1,241 +0,0 @@ - - - - Ruby on Rails: Welcome aboard - - - - -
- - -
- - - - -
-

Getting started

-

Here’s how to get rolling:

- -
    -
  1. -

    Use rails generate to create your models and controllers

    -

    To see all available options, run it without parameters.

    -
  2. - -
  3. -

    Set up a default route and remove public/index.html

    -

    Routes are set up in config/routes.rb.

    -
  4. - -
  5. -

    Create your database

    -

    Run rake db:create to create your database. If you're not using SQLite (the default), edit config/database.yml with your username and password.

    -
  6. -
-
-
- - -
- -