Getting ActionViewTemplate error in Heroku but not local rails environment
<p>I am deploying to Heroku and keep getting an error when loading the form to create a new room </p>

<pre><code>ActionView::Template::Error (undefined method 'attractions' for Room)
</code></pre>

<p>I have added :attractions in permitted params in the RoomsController</p>

<pre><code>params.require(:room).permit(:attractions)
</code></pre>

<p>and this is what the attractions text field looks like in the form</p>

<pre><code>&lt;%= form_for @room, html: {multipart: true} do |f| %&gt;
      &lt;label for="textarea2" style="font-size: 17px; color: #0089ec;"&gt;Neighborhood Attractions&lt;/label&gt;
      &lt;%= f.text_area :attractions, autofocus: true, :placeholder =&gt; "What tourist attractions are in your city", :class =&gt; "materialize-textarea"  %&gt;
</code></pre>

<p>This is the migration created to add the attractions field</p>

<pre><code>class AddAttractionsToRoom &lt; ActiveRecord::Migration
    def change
        add_column :rooms, :attractions, :text
    end
end
</code></pre>

<p>and finally in the show page I have this         </p>

<pre><code> &lt;div class="col m8 offset-m1 s12"&gt;
       &lt;p class="grey-text"&gt;&lt;%= @room.attractions %&gt;&lt;/p&gt;

 &lt;/div&gt; 
</code></pre>

<p>Does anybody know why this is happening? Thanks</p>

<p>UPDATE:</p>

<p>So i checked the logs and found the problem is that i made migration errors and rake was aborting before the attractions field is created.</p>

<p>Here is the mess i made:</p>

<p>first i add a city_limit boolean field</p>

<pre><code>class AddAmenitiesToRoom &lt; ActiveRecord::Migration
    def change
        add_column :rooms, :city_limit, :boolean    
    end
end
</code></pre>

<p>then for some reason I forgot I had created the city_limit boolean field and instead thought I had a city string field. So I thought I should rename it to city_limit with this migration</p>

<pre><code>class ChangeColumnName &lt; ActiveRecord::Migration
    def change
        change_column :rooms, :city, :city_limit, 'boolean USING CAST(test_type AS boolean)'
    end
end
</code></pre>

<p>And finally I decided, you know what, I think I need a city string field after all for geolocation so added another migration</p>

<pre><code>class AddAcityToRoom &lt; ActiveRecord::Migration
    def change
        add_column :rooms, :city, :string
    end
end
</code></pre>

<p>Embarrassing, I know. Staying up late coding away is never good. But the problem can be easily fixed by removing this migration, </p>

<pre><code>class ChangeColumnName &lt; ActiveRecord::Migration
    def change
        change_column :rooms, :city, :city_limit, 'boolean USING CAST(test_type AS boolean)'
    end
end 
</code></pre>

<p>I just dont know if deleting the migration file is a good idea since I have already run rake db:migrate and there are about 10 other migrations after this one so rake db:rollback is not really an option</p>