1

Let's get down to brass tacks.

Rails: 2.3.11

I have a controller using inherited_resources to reference two separate and non-nested resources.

My controller is as shown:

class Tools::DeploymentLinesController < ToolsController
  inherit_resources
  belongs_to :deployment
  belongs_to :ticket
end#Tools::DeploymentLinesController

However, inherit_resources is assuming that the belongs_to :ticket is a nested resource of deployment.

Is there any way of using two belongs_to in my controller without nesting? Or do I need to write out my own business logic to account for a missing inherited_resources association?

CITguy
  • 11
  • 2

1 Answers1

2

You should be able to use:

belongs_to :deployment, :ticket
Toby Hede
  • 36,755
  • 28
  • 133
  • 162