My question is this:
How do you structure the loop to go through both arrays and display
based on date so that the result could be two, intertwined lists.
Example:
My question is this:
How do you structure the loop to go through both arrays and display
based on date so that the result could be two, intertwined lists.
Example:
your class definitions might look lke
class Article < ActiveRecord::Base
belongs_to :content, :polymorphic =>
end
class News < ActiveRecord::Base
has_one :article, as => :content
end
class Sports < ActiveRecord::Base
has_one :article, as => :content
end
Also, refer to Polymorphic Associations section in Chapter 18.4 Joining
to Multiple Tables of Agile Web D. with Rails (third edition).
If you dont have this book, i HIGHLY recommend you get it from
class Article < ActiveRecord::Base
belongs_to :content, :polymorphic => true
end
class News < ActiveRecord::Base
has_one :article, as => :content
end
class Sports < ActiveRecord::Base
has_one :article, as => :content
end
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.