Daniel Kehoe
Daniel Kehoe

Reputation: 10952

Reference checklist for starting a new Rails application?

It's easy to create a new Rails application using "rails new myapp" (or start with a template from Rails Wizard or the RailsApps project).

But after that, what do you do? What gems do you always add? What decisions do you make before beginning development? What important items are often overlooked before deploying an app?

I'd like to put together a reference checklist to share. Any suggestions?

For example:

What else?

Upvotes: 17

Views: 3977

Answers (8)

Jeriko
Jeriko

Reputation: 6637

I got tired of having to remember and repeat the mundane tasks required for every new app.

If you're looking for guidance on getting started, we've recently (yesterday!) released a tool to speed up the process, with all sorts of tried and tested libraries for the various aspects of a Rails web app, as well as cleanup scripts to get the fresh app just the way it should be.

Check out http://drone.bz to build an app the same way we do. Under the hood, it uses the app_drone gem to resolve dependencies and build the actual template, but the UI is probably all you need to get started.

There are several similar tools out there, but I decided to be highly opinionated in my recipe choices, and the end result is a solid foundation on which to start developing :)

P.S. Even if you don't use the drones, you can take a look at the steps that are common enough in Rails dev to be automated.

Upvotes: 1

sprysoft
sprysoft

Reputation: 1568

For me usual process involves:

  • Add CSS framework (grids, text, forms)
  • Add Cells
  • Add Slim (www.slim-lang.com)
  • Remove Test::Unit for RSpec
  • Add application config settings (config.yml)
  • Add Cucumber
  • Add FactoryGirl
  • Add Spork
  • Add Guard (guard-rspec, guard-cucumber, guard-sass, guard-livereload, guard-spork)
  • Add Git, Github space, + amend .gitignore
  • Add Heroku (stage + production) spaces

I'll usually copy over my google_analytics helpers and sitemap_controller from other projects during the development process instead of being organised enough to do it from the start. I like to the the testing and deployment options setup from the get go so I can start developing and releasing early and often.

Dave

Upvotes: 6

Leszek Zalewski
Leszek Zalewski

Reputation: 426

Most of the time:

  1. Configuration
    • add .rvmrc
    • amberbit-config gem (avaible at GH)
    • modify .gitignore
  2. Views
    • haml to sass/coffee stack
    • rdiscount
  3. Tests
    • rspec instead of unit tests
    • capybara, factory_gril, spork, timecop
  4. Development
    • guard-livereload, with guard, libnotify etc.
    • active_reload for faster development with assets pipeline
    • annotate if relational db
    • pry

I almost forgot to mention: mix of html5 boilerplate for rails with twitter bootstrap it's good combo.

Upvotes: 3

jassa
jassa

Reputation: 20191

create rvm gemset, create .rvmrc, modify .gitignore

Then add gems

  • gem 'pg'
  • gem 'thin'
  • gem 'ruby-debug19', :require => 'ruby-debug'
  • gem 'rspec-rails'
  • gem 'factory_girl_rails'
  • gem 'capybara'

then depending on the project, I often use aws3, paperclip, resque, will_paginate and haml (although I try not to use it on new projects anymore)

Upvotes: 3

Grocery
Grocery

Reputation: 2274

I don't add anything. Things get added if project requires them.

  • I don't load up CSS framework just because there's a need for two columns and a rounded button somewhere.
  • I don't load FactoryGirl because rails test fixtures actually do a fine job as long as you know how to use them. (Hint: you don't need 100 instances of User in your fixtures)
  • I don't load RSpec/Cucumber/etc because UnitTest is just as good and I prefer keeping things simple.

There's absolutely no reason to bloat project with things just because you "might need it"

Upvotes: 1

user191766
user191766

Reputation:

  • I always want to set up Factory Girl under /fixtures, and setup Cucumber along Rspec. Sometimes I use shoulda too.
  • Initialize the project as a git repository and link it to github. Set up the app to use PostgreSQL instead of SQLite.
  • And last I can think of is that I often make an entry, from the beginning, to load .rb files form /lib automatically.

Upvotes: 1

timtyrrell
timtyrrell

Reputation: 11

The first think that I do is head to http://railswizard.org/ and create a template, before "rails new app".

Upvotes: 1

Related Questions