Yesterday I was at the MountainRB ruby workshop, which was basically an intro to rails class. It was a really good workshop and here are some tips I picked up.


Change the config/cucumber.yml file to display pretty output, making it easier to see the failed step.

default: -format pretty

use Background: in cucumber features for tasks that need to happen for every scenario. Use just like Scenario

Background: Make sure that we have a topic
  Given I go to the topics page
  And I follow "New Topic"
  And I fill in "Title" with "Rails Fixtures" 
  And I fill in "Description" with "Introduce how to add test data with fixtures."
  And I press "Create"

Rails templates

When you create a new rails application you can specify a template that runs after the initial generation. It can handle a lot of the initial setup. Here’s the one used used in the workshop


View a models attributes

From inside the rails console you can view a models attributes by calling class on an instance of the Model.

ruby-1.9.2-p0 > (


rake routes will show the routes defined for the application.

        login        /login(.:format)          {:action=>"new", :controller=>"user_sessions"}
         logout        /logout(.:format)         {:action=>"destroy", :controller=>"user_sessions"}
user_sessions GET    /user_sessions(.:format)  {:action=>"index", :controller=>"user_sessions"
user_sessions POST   /user_sessions(.:format)  {:action=>"create", :controller=>"user_sessions"}


Rails will cascade saves in a transaction by default

The resource generation option will create the model and migration, while adding a blank controller and empty views directory.

rails generate resource

heroku open shows the current heroku app in the browser.

Resources – Resources from DevChix – Rails documentation – Boulder user group – Denver user group - an inclusive and friendly Ruby on Rails community