Table of Contents

Tips for Beginners

Forget Everything You Have Learned About Web Development Thus Far

Rails is not .NET or PHP, nor does it try to emulate their methodologies.

Study and understand the MVC and REST conceptual frameworks before you start building a Ruby on Rails application—it will both accelerate your learning of the Rails framework, and improve the quality of your application.

If you are finding something very difficult or very awkward to build in Rails, recheck that you are conforming with the MVC and REST patterns; it is not mandatory to use these patterns, but you will often find that it is significantly harder to implement something that ignores them. Choosing to do things another way should be done with deliberation.

Learn the Fundamental Tenets of Ruby on Rails

Read and learn the Basic tenets of Ruby on Rails before you start developing with the Rails framework. The Ruby on Rails community places particular emphasis on Convention over Configuration (see also Ruby and Rails Naming Conventions) and the rapid development principle of Don't Repeat Yourself (DRY). These fundamental tenets are not just catchphrases – they are the fundamental concepts underlying much of how the Ruby on Rails framework approaches application development. An awareness of these concepts will make using the framework more intuitive. While in most cases it's better to respect these core principals as you work with the framework, there may be occasions when it is more effective to deviate from them. Regardless, choosing to disregard these concepts should be done deliberately (and properly documented in your code so that others understand how and why it was done.)

Use a Version Control System

Nothing can be as frustrating as making some seemingly minor change and breaking something unintended. Using a version control system such as Git, Mercurial, Subversion, or CVS allows you to make changes and easily undo them should something break.

Most of the Rails community uses Git, so, if you're new to version control, start there.

Git

Search for Answers (RTFM)

While there are many helpful people in the Rails and Ruby communities that make themselves available through various channels, try sorting out your problems on your own before soliciting their help. Most problems are not unique and have been solved or answered either in this wiki or elsewhere online.

Ruby, the Rails Framework, and most major plugins and gems have significant online documentation and rdocs that you can generate yourself, plus you can always look at the relevant code directly. This isn't to say that asking for help is to be avoided at all costs, but some effort to find solutions should be made prior to asking someone.

If you do need help, two great sources of information are the Ruby on Rails talk mail list and the #rubyonrails IRC channel on Freenode. Both will give you access to experienced Ruby and Rails developers who would be happy to help.

Learn Ruby Too, Not Just Rails

Learn Ruby's conventions and how to write better Ruby code. Try to not bring baggage from prior languages with you.

def add(a,b)
  # bad - "return" is optional and not necessary
  return a + b
  # good, the value of the last statement is returned by default
  a + b
end
# bad, hard to read and understand
puts "NO" if not @user.has_permission?
# good, meaning is clear
puts "NO" unless @user.has_permission?

Good (and free) introductions to Ruby can be found either on the official homepage ruby-lang.org or in the form of online courses at rubylearning.org.

Learn to Love to Test

While testing might seem big and scary at first, you will learn to love the “big guy” once you try it. Testing is something “big” in the Rails development community, and it should be for you as well. The first time you “get it” is like seeing a ray of sunshine through the muck and mire of other development practices. Read. Learn. Love.

Keep an eye out for choice screencasts

There are number of high profile screencast sites that are worth keeping an eye on. These are but a few, sign up to their RSS feeds and pop in every now and then for a cup of tea.

http://www.railsenvy.com

http://www.railscasts.com

http://www.peepcode.com

http://www.learnivore.com (aggregator, comes with RSS feed and twitter account)