title: Undefined method on create with has_many and belongs_to relationship
body: <p>When i try to access to a method created by the relationship has_many - belogs_to, i get an undefined method error . Here is the code (semplified) :</p>
  
  <p>local.rb (model) :</p>
  
  <pre><code>class Local &lt; ActiveRecord::Base
     has_many :foods, dependent: :destroy, :foreign_key =&gt; 'local_id'
  end
  </code></pre>
  
  <p>food.rb :</p>
  
  <pre><code>class Food &lt; ActiveRecord::Base
     attr_accessible :descrizione, :nome, :prezzo, :voto
     belongs_to :local, :foreign_key =&gt; 'local_id'
  end
  </code></pre>
  
  <p>the /locals/show.html.erb view that calls the create action on foodsController :</p>
  
  <pre><code>...
  
  &lt;%= form_for :food, :url =&gt; {:controller  =&gt; :foods, :action =&gt; :create} do |f| %&gt;
  ...
  &lt;% end %&gt;
  </code></pre>
  
  <p>foods_controller.rb</p>
  
  <pre><code>class FoodsController &lt; ApplicationController
      def create
          @food = @local.foods.build(params[:food])
      end
  end
  </code></pre>
  
  <p>The problem is raised here in foods_controller on create action : "undefined method 'foods' ' . Why? the relationship should enable the local.foods method?
  (@local is defined in locals_controller.rb, @local = Local.find(params[:id]) , and local_id attribute is defined in schema.rb and in the last db migration , just to be clear)</p>
  
  <p>Thank you</p>