title: Rails 3.1.1 polymorphic nested form view not working -- works fine in Rails 3.0.10
body: <p>So perhaps I've found a bug in Rails 3.1.1, or else I don't understand if Rails 3.1(.1) has changed in some way from Rails 3.0.10 with Nested Resources, Polymorphic associations, and/or routing...</p>
  
  <p>Under Rails 3.0.10 the following works fine, but under Rails 3.1.1 it doesn't!</p>
  
  <p>These are my models:</p>
  
  <pre><code>class Picture &lt; ActiveRecord::Base
    belongs_to :imageable, :polymorphic =&gt; true
  end
  
  class Employee &lt; ActiveRecord::Base
    has_many :pictures, :as =&gt; :imageable
  end
  
  class Product &lt; ActiveRecord::Base
    has_many :pictures, :as =&gt; :imageable
  end
  </code></pre>
  
  <p>My routes.rb:</p>
  
  <pre><code>resources :employees do
    resources :pictures
  end
  resources :products do
    resources :pictures
  end
  </code></pre>
  
  <p>My controller:</p>
  
  <pre><code>class PicturesController &lt; ApplicationController
    def index
      @imageable = find_imageable
      @pictures = @imageable.pictures
    end
  
    private
    def find_imageable
      params.each do |name, value|
        if name =~ /(.+)_id$/
          return $1.classify.constantize.find(value)
        end
      end
      nil
    end
  end
  </code></pre>
  
  <p>My app/views/pictures/index.html.erb:</p>
  
  <pre><code>&lt;% form_for [@imageable, Picture.new] do |f| %&gt;
      &lt;p&gt;&lt;%= f.submit "Add picture" %&gt;&lt;/p&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>I generated the apps with <code>rails new poly -T</code> (for Rails 3.1.1 and for Rails 3.0.10).</p>
  
  <p>I used standard scaffold commands: <code>rails g scaffold Employee name:string</code>, <code>rails g scaffold Product title:string</code> and <code>rails g scaffold Picture caption:string imageable_id:integer imageable_type:string</code> and then migrating, of course.</p>
  
  <p>When hitting the index form (/employees first to create an employee with id == 1; then /employees/1/pictures) I get a blank form (no button appears) on Rails 3.1.1, and a form <em>with</em> the submit button on it, on Rails 3.0.10...</p>
  
  <p>Any ideas if I'm doing something wrong in Rails 3.1.1, or have I really found a bug (I doubt it--I'm sure I'm doing something stupid!)?</p>