title: How do I build a nested form in Refinerycms?
body: <p>I am trying to nest a form with two resources (Map and Location).
  I'm following the Nested Forms tutorial from Ryan Bates however I must be missing something.</p>
  
  <p>Map Model:</p>
  
  <pre><code>module Refinery
    module Maps
      class Map &lt; Refinery::Core::BaseModel
        self.table_name = 'refinery_maps'
  
        attr_accessible :name, :position, :questions_attributes
  
        validates :name, :presence =&gt; true, :uniqueness =&gt; true
        has_many :locations
  
        accepts_nested_attributes_for :locations 
      end
    end
  end
  </code></pre>
  
  <p>Location Model:</p>
  
  <pre><code>module Refinery
    module Maps
      class Location &lt; Refinery::Core::BaseModel
  
        attr_accessible :latitude, :longitude, :address, :description, :title, :position
  
        validates :address, :presence =&gt; true, :uniqueness =&gt; true
        belongs_to :map
      end
    end
  end
  </code></pre>
  
  <p>View:</p>
  
  
          
              
                  
                  
                  
                  
                  
                
          
  
  
  <p>Controller(decorator):</p>
  
  <pre><code>Refinery::PagesController.class_eval do
  
    before_filter :new
  
    private  
      def new
        @map = Map.new
        3.times { @map.locations.build }
      end
  
    end
  </code></pre>
  
  <p>Schema:</p>
  
  <pre><code>  create_table "refinery_maps_locations", :force =&gt; true do |t|
      t.float    "latitude"
      t.float    "longitude"
      t.string   "address"
      t.string   "description"
      t.string   "title"
      t.integer  "position"
      t.datetime "created_at",  :null =&gt; false
      t.datetime "updated_at",  :null =&gt; false
      t.integer  "map_id"
    end
  
    create_table "refinery_maps", :force =&gt; true do |t|
      t.string   "name"
      t.integer  "position"
      t.datetime "created_at", :null =&gt; false
      t.datetime "updated_at", :null =&gt; false
    end
  </code></pre>
  
  <p>Routes:</p>
  
  <pre><code>Refinery::Core::Engine.routes.draw do
  
    # Frontend routes
    namespace :maps do
      resources :maps, :path =&gt; '', :only =&gt; [:index, :show]
    end
  
    # Admin routes
    namespace :maps, :path =&gt; '' do
      namespace :admin, :path =&gt; Refinery::Core.backend_route do
        resources :maps, :except =&gt; :show do
          collection do
            post :update_positions
          end
        end
      end
    end
  
  
    # Frontend routes
    namespace :maps do
      resources :locations, :only =&gt; [:index, :show]
    end
  
    # Admin routes
    namespace :maps, :path =&gt; '' do
      namespace :admin, :path =&gt; "#{Refinery::Core.backend_route}/maps" do
        resources :locations, :except =&gt; :show do
          collection do
            post :update_positions
          end
        end
      end
    end
  
  end
  </code></pre>