Skip to content

Instantly share code, notes, and snippets.

@diegodurs
Created September 11, 2012 09:24
Show Gist options
  • Save diegodurs/3697173 to your computer and use it in GitHub Desktop.
Save diegodurs/3697173 to your computer and use it in GitHub Desktop.
Build new Rails App

Generate new app

Don't forget -T -d postgresql. One day create a template and builder

  • rails new AppName -T -d postgresql

Use rspec, haml, coffee, scss

  • rails generate rspec:install In application.rb:
config.generators do |g|
  g.view_specs false
end

Use guard (autotest like)

In config/environments/development.rb:

  • config.middleware.insert_after(ActionDispatch::Static, Rack::LiveReload)
  • guard init livereload
  • guard init rspec
  • guard

Use boostrap

Edit boostrapandoverride to remove the 60px. Comment scaffold.css generated by rails.

  • rails g bootstrap:install
  • rails g bootstrap:layout application fixed

Use simple_form

  • rails generate simple_form:install --bootstrap

Use Devise

  • rails generate devise:install
  • rails generate devise User
  • rails generate devise:views

Instal postgress

  • createuser MyApp --superuser
  • createdb -OMyApp -Eutf8 MyApp_development
  • createdb -OMyApp -Eutf8 MyApp_test
  • psql -U MyApp MyApp_development
source 'https://rubygems.org'
gem 'rails', '3.2.5'
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'jquery-rails'
gem "haml", ">= 3.0.0"
gem "haml-rails" # haml generator
group :development, :test do
gem "rspec-rails", ">= 2.0.1"
gem 'factory_girl_rails'
gem 'capybara'
gem 'database_cleaner'
gem 'sqlite3'
end
group :development do
gem 'annotate', '2.4.1.beta1' # bundle exec annotate -r
gem 'sqlite3'
end
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem "twitter-bootstrap-rails"
gem 'simple_form'
gem 'devise'
gem 'hominid'
gem 'cancan'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment