Scaffold_all_models and has_and_belongs_to_many

Hello,

I beg your pardon for this surely stupid problem, but I’m new in RoR
world.

I created 3 views inheriting ActiveRecord::Base , lets call them a,b,c.
a and b are linked by a table (a_b_fk) and the corresponding foreign
keys.
Now, when I generate the “administration” page by simply calling
scaffold_all_models (from Scaffolding Extensions Plugin) everything
works fine, but if I had has_and_belongs_to_many :a in b and
symmetrically in a, I get an error :

compile error
/var/www/rails/esoxCMS/vendor/plugins/scaffolding_extensions/lib/scaffolding_extensions.rb:1:
syntax error, unexpected kDEF, expecting $end
false def _manage_a

Could anyone explain me what’s I’m doing wrong?

Thanks in advance

Sounds like a question for the Scaffolding Extensions Plugin
author(s).

On Sep 4, 5:57 pm, Stefano G. [email protected]

Ok thanks, I’ll ask him. I thought I was doing something against “RoR
logics”

Stefano G. wrote:

Hello,

I beg your pardon for this surely stupid problem, but I’m new in RoR
world.

I created 3 views inheriting ActiveRecord::Base , lets call them a,b,c.
a and b are linked by a table (a_b_fk) and the corresponding foreign
keys.
Now, when I generate the “administration” page by simply calling
scaffold_all_models (from Scaffolding Extensions Plugin) everything
works fine, but if I had has_and_belongs_to_many :a in b and
symmetrically in a, I get an error :

compile error
/var/www/rails/esoxCMS/vendor/plugins/scaffolding_extensions/lib/scaffolding_extensions.rb:1:
syntax error, unexpected kDEF, expecting $end
false def _manage_a

Could anyone explain me what’s I’m doing wrong?

Thanks in advance

Most likely the reflection doesn’t exist or it isn’t
:has_and_belongs_to_many. See line 1099 of scaffolding_extensions.rb.
If I had to guess, you are using:

class B
has_and_belongs_to_many :a
end

instead of:

class B
has_and_belongs_to_many :as
end

But I wouldn’t know for sure until you paste your model code.

Jeremy