Topic: accessing associated data from models in the form
Hi ,
I want to implement a searchpage for streams by selecting the parameters to be searched from different models.
I have three models called:
containerformat
transport_stream
program
and controllers:
containerformats
transport_streams
programs
streams
each has association like:
in containerformat model:
has_many :transport_streams
belongs_to:programs
belongs_to:streams
in transport_stream model:
has_many :programs
belongs_to:streams
in program model:
has_many :streams
now i want to access the data in the index.html.erb of containerformats from transportstreams and programs .
i found somthing like we need to use 'feilds_for' in the form but i could not able to get the values from other models.
Can any one suggested how to get it work.
thanks
Srikanth