Skip to content

Instantly share code, notes, and snippets.

# Examples of Nesting Associated Attributes
# This is a look at the various ways to set associated attributes through
# nested parameters. For example, let's say Project has_many :tasks and
# we want to update the tasks the same time we edit a project. There are
# several ways this interface could be handled, and here are a few.
#
# For these examples, we're trying to create two new tasks and update an
# existing task (with id 3) through a project.
# Approach 1
@lightcap
lightcap / deploy.rb
Created February 21, 2009 01:50 — forked from defunkt/deploy.rb
# deploy to staging from your current topic branch, with ease
set :branch, "origin/#{`git branch`.scan(/^\* (\S+)/)}"