This is my first time on ruby-forum so pardon if this is not posted
I am having a very similar issue regarding has_many through has_many. A
logged user can create a work order and associated fields in models name
alias and sub_tasks. I am using active_admin and an admin user can view
and edit the above mentioned models, but when admin tries to create a
sub_task I can get the following error:
Cannot modify association 'WorkOrder#sub_tasks' because the source
reflection class 'SubTask' is associated to 'NameAlias' via :has_many.
class work_order < ActiveRecord::Base
has_many :sub_tasks, :through => :name_aliases
class NameAlias < ActiveRecord::Base
class SubTask < ActiveRecord::Base
A pervious post mentioned a solution using an after_save method before
declaring the association... but I didn't see sample code? since i am
new to rails it would be helpful to see or example how this can be
resolved. Thanks for your help!