title: What is the form_for syntax for nested resources?
body: <p>I am trying to create a form for a nested resource. Here is my route:</p>
  
  <pre><code>map.resources :websites do |website|
    website.resources :domains
  end
  </code></pre>
  
  <p>Here are my attempts and the errors:</p>
  
  <pre><code>&lt;% form_for(@domain, :url =&gt; website_domains_path(@website)) do | form | %&gt;
  &lt;%= form.text_field :name %&gt;
  
  # ArgumentError: wrong number of arguments (1 for 0)
  # form_helper.rb:290:in 'respond_to?'
  # form_helper.rb:290:in 'apply_form_for_options!'
  # form_helper.rb:277:in 'form_for'
  
  &lt;% form_for([@website, @domain]) do | form | %&gt;
  &lt;%= form.text_field :name %&gt;
  
  # ArgumentError: wrong number of arguments (1 for 0)
  # form_helper.rb:290:in 'respond_to?'
  # form_helper.rb:290:in 'apply_form_for_options!'
  # form_helper.rb:277:in 'form_for'
  
  &lt;% form_for(:domain, @domain, :url =&gt; website_domains_path(@website)) do | form | %&gt;
  &lt;%= form.text_field :name %&gt;
  
  # ArgumentError: wrong number of arguments (1 for 0)
  # wrapper.rb:14:in 'respond_to?'
  # wrapper.rb:14:in 'wrap'
  # active_record_helper.rb:174:in 'error_messages_for'
  
  &lt;% form_for(:domain, [@website, @domain]) do | form | %&gt;
  &lt;%= form.text_field :name %&gt;
  
  # UndefinedMethodError 'name' for #&lt;Array:0x40fa498&gt;
  </code></pre>
  
  <p>I have confirmed both <code>@website</code> and <code>@domain</code> contain instances of the correct class.</p>
  
  <p>The routes also generate correctly is used like this for example, so I dont think their is an issue with the route or url helpers.</p>
  
  <pre><code>&lt;%= website_domains_path(1) %&gt;
  &lt;%= website_data_source_path(1, 1) %&gt;
  </code></pre>
  
  <p>Rails 2.3.5</p>