in model:
Charge.
has_many :budget_plans
has_many :rollups, :through => :budget_plans
in Controller:
@charge = Charge.find(1, :include => :rollups)
In View:
@charge.rollup.fieldname
Adam
in model:
Charge.
has_many :budget_plans
has_many :rollups, :through => :budget_plans
in Controller:
@charge = Charge.find(1, :include => :rollups)
In View:
@charge.rollup.fieldname
Adam
AD wrote:
in model: Charge. has_many :budget_plans has_many :rollups, :through => :budget_plans
in Controller:
@charge = Charge.find(1, :include => :rollups)
In View:
@charge.rollup.fieldname
Adam
On Wed, Mar 12, 2008 at 1:35 PM, Matthew Williams <
So this is a bit of an improvement over what I had before but the issue of modifying the records in the BudgetPlan model from the Charge views isn't solved.
Ultimately I would like every record from rollup to be displayed on the edit view for the charge model. If I decide to enter a value for a specific rollup and submit the form a record is created in the BudgetPlan model containing the ID of the charge, the ID of the rollup and the hours value.
Still hacking away...