I want to find array, but gow can i do this?
@model = Model.find(:first, :conditions => { :MOD_MFA_ID => params[:man]})
@ct = CountryDesignation.find(:first, :conditions => { :CDS_ID => "110000002"})
but :CDS_ID => "110000002" is not good. I need to select it via @model.Field, for example: :CDS_ID => @model.Field. But also @model is not just one entry, it's an array. So I need for every Model select CountryDesignation. But then I need to select from CountryDesignation array DesText array
@destext = DesText.find(:all, :conditions => { :TEX_ID => @ct.Field})
How to do this work? And how to correct view this?
%table %tr %th Mfa id %th Год начала выпуска %th Год завершения выпуска - @model.each do |model| %tr %td= link_to model.MOD_ID, model %td= link_to model.MOD_PCON_START, model -if model.MOD_PCON_END.blank? %td= link_to "По настоящее время", model -else %td= link_to model.MOD_PCON_END, model -#%td= model.country_designations.des_texts.TEX_TEXT -#= link_to 'Show model', model %br - @destext.each do |t| name %td= t.TEX_ID %td= t.TEX_TEXT - @ct.each do |ct| ct %td= ct.CDS_ID %td= ct.CDS_TEX_ID