I have 2 models named Subject & Page. there is one to many association between them.
class Subject < ActiveRecord::Base
has_many :pages
attr_accessible :name
attr_accessible :position
attr_accessible :visible
attr_accessible :created_at
end
and
class Page < ActiveRecord::Base
belongs_to :subject
attr_accessible :subject_id
attr_accessible :name
attr_accessible :permalink
attr_accessible :position
attr_accessible :visible
attr_accessible :created_at
end
I have list.html.erb in view -> pages folder.
Q. My qus is I want to show all the subject_id in list.html.erb. how? for that which changes I have to do in pages_controller & list.html.erb so that I will got solution...