This project is archived and is in readonly mode.

#3688 ✓invalid
agmcleod

undefined method `table_alias' - scaffold index action

Reported by agmcleod | January 13th, 2010 @ 01:36 AM

Installed Rails 3 pre today. As a test app, I went for creating a cookbook. After creating the application directories, I used the scaffold command to create a Recipe model, and a corresponding controller and the views. After creating the database and table, I launched my application through the script/server command. The default rails page came up fine, however going to http://localhost:3000/recipes I receive a NoMethodError.

undefined method table_alias' for #<Arel::Table:0x60c57a0><br/> Rails.root: C:/Users/Aaron/Documents/programming/rails/cookbook

Application Trace | Framework Trace | Full Trace
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-3.0.pre/lib/active_record/relation.rb:185:in references_eager_loaded_tables?'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-3.0.pre/lib/active_record/relation.rb:46:inall'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-3.0.pre/lib/active_record/base.rb:651:in send'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-3.0.pre/lib/active_record/base.rb:651:infind'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-3.0.pre/lib/active_record/base.rb:674:in all'<br/> C:/Users/Aaron/Documents/programming/rails/cookbook/app/controllers/recipes_controller.rb:6:inindex'
C:1:in __send__'<br/> C:1:ininstrument'

Line 6 refers to:
@recipes = Recipe.all

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages