I fixed this by adding a column for the nested collection. In your
case, adding: config.column << 'individuals' will do the trick. It's
not pretty though and I don't know why this is.

On 18 sep, 19:07, Walksalong <[email protected]> wrote:
> Hi Kerry,
>
> I was using HABTM and it was working lovely, but the requirements
> changed and I needed to add additional fields to the join table.
> That's when everything started breaking.
>
> Thanks,
> Paul
>
> On Sep 18, 12:53 pm, Kerry Foley <[email protected]> wrote:
>
> > Have you tried using has_and_belongs_to_many? It seems more suited to
> > what you are trying to do (assuming flashpoints_individuals just has the
> > 2 ids and no other attributes). I'm not 100% sure what is causing the
> > error but check out the info/prior posts on reverse associations. Also I
> > think :through associations are read only so maybe the error is related
> > to that.
>
> > Regards,
> > Kerry
>
> > Walksalong wrote:
> > > I can't seem to get any has_many through relationships/subforms to
> > > work on the latest AS with Rails 2.3.2.
>
> > > flashpoint.rb
> > > has_many :flashpoints_individuals, :dependent => :delete_all
> > > has_many :individuals, :through => :flashpoints_individuals
>
> > > individual.rb
> > > has_many :flashpoints_individuals, :dependent => :delete_all
> > > has_many :flashpoints, :through => :flashpoints_individuals
>
> > > flashpoints_individual.rb
> > > belongs_to :flashpoint
> > > belongs_to :individual
>
> > > Added a subform link in my controller:
> > > config.nested.add_link("Flashpoints", [:flashpoints])
>
> > > Load up an individual list page and click on the flashpoints link
> > > returns:
>
> > > ActiveRecord::StatementInvalid in FlashpointsController#table
>
> > > Mysql::Error: Unknown column 'individuals.id' in 'where clause':
> > > SELECT count(*) AS count_all FROM `flashpoints` WHERE
> > > (((individuals.id = '1860')))
>
> > > Am I missing something?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to