/rails3_base

A rails 3 base app for quick-start development

Primary LanguageRuby

This is a base application for rails 3.

To Install and Deploy
1. Pull
$ git clone git@github.com:mplatts/rails3_base.git

2. Rename App
Places to change name (look for "Rails3Base"):
- root folder name
- config/environments/test.rb
- config/environments/development.rb
- config/environments/production.rb
- config/environment.rb
- config/application.rb
- config/routes.rb
- config.ru

3. Setup DB
- edit database.yml
$ rake db:create

4. Github and Deploy
$ git add .
$ git commit -m 'first commit'
$ git remote add origin <your-newly-created-git-repo>
$ git push origin master
$ heroku create
$ git push heroku master
$ heroku stack:migrate bamboo-mri-1.9.1

If you are getting errors with public key
$ heroku keys:add ~/.ssh/id_rsa.pub

5. Edit and Push over and over
Basically repeat step 4 when you add your new code - eg every hour or whatever

*Gems*
Views
- Haml
- Compass
- Hassle, :git => "http://github.com/thedigitalants/hassle"

Testing
- Cucumber
- Rspec
- Webrat
- Factory Girl

*Javascript*
- jQuery

*Hosting*
It is made to be hosted on Heroku
- postgresql database (same as Heroku)
  - go here for tips on linux "https://help.ubuntu.com/community/PostgreSQL"
- Sass in app/stylesheets works on Heroku thanks to the particular Hassle branch



*Steps I performed to make this base app:*
$ rails new <appname> --skip-testunit

# gemfile---------------------------------

source 'http://rubygems.org'
gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'mysql'
gem 'haml'
gem 'compass'

# Cucumber on Rails 3 http://github.com/aslakhellesoy/cucumber-rails/blob/master/README.rdoc

group :test do
  gem "rspec-rails", ">= 2.0.0.beta.17"
  gem "factory_girl_rails"
  gem 'autotest'
  gem 'capybara'
  gem 'database_cleaner'
  gem 'cucumber-rails'
  gem 'cucumber'
  gem 'spork'
  gem 'launchy'
end

=> bundle install

#set rails to use rspec --------------------------------
go to application.rb

  config.generators do |g|
    g.template_engine :haml
    g.test_framework :rspec, :fixture => true, :views => false
    g.fixture_replacement :factory_girl, :dir => "spec/factories"
  end

#install cucumber and rspec and compass---------------------------------
$ rails g cucumber:install --rspec --capybara
$ rails g rspec:install
$ compass init rails . --using blueprint/semantic


# go to spec/spec_helper.rb 

# up the top
require 'capybara/rails'
require 'capybara/dsl' 

# and add after config

  config.include(Capybara, :type => :integration) 
  config.include Haml::Helpers
  config.include ActionView::Helpers
  config.before(:each) do
    init_haml_helpers
  end

# weird thing that kept telling me to do this when I ran server
# add to config/environments/development.rb:
config.active_support.deprecation = :log