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
-~----------~----~----~----~------~----~------~--~---