1
has_many Task_Orders 계약 모델이 있습니다. Contract 광고 항목에 대해 '표시'를 클릭하면 해당 계약에 속한 Task_Orders 목록이 표시되는보기를 렌더링하려고합니다.부모 레일의 자식 렌더링 4.0
다음class Contract < ActiveRecord::Base
has_many :task_orders
end
내 작업 주문 모델 : 여기
create_table "task_orders", force: true do |t|
t.integer "contract_Id", limit: 255
t.string "task_orderId"
t.string "task_orderName"
내 계약 모델 :
여기
create_table "contracts", force: true do |t|
t.string "contractId"
t.string "contractName"
내 작업 주문 스키마입니다 : 여기
내 계약 스키마입니다 :class TaskOrder < ActiveRecord::Base
belongs_to :contract
end
컨트롤러와 작업하는 방법을 잘 모르겠습니다 .... 도와주세요. 레일즈 4.0을 사용 중입니다.
고맙습니다.
가능한 중복
[부모 클래스의 표시 아이들이 레일 4.0 (http://stackoverflow.com/questions/23833091/show-children-of-a-parent-class-rails-4-0) –