I’m new to Ruby on Rails and am working on my first major app. I’m
having a bit of trouble figuring out the best way to do some things. The
first issue I’m having is regarding an events page. I have 3 divs on my
page, that will each display different levels of event details in
different formats. For example, the first one will show all of the event
details in a very graphical format. The next div will show only the next
5 events with only the event name and date and a smaller picture. The
final div will show the rest of the events in table form, and be able to
paginate through the whole result set. I hope to eventually have it
display in a calendar format.
I will be using partials within each div to display the appropriate list
format (thanks to reading through this forum!).
In my event controller I’ve got the list action that was generated by
the scaffold, and contains all the results paginated. My question is
this: is there any way to use the result set from this list to populate
all three divs, limiting the result set on a case by case basis, or
should I be writing separate actions for each type of listing? If it is
possible to limit which results are shown on the view (partial) level,
how would I go about that?
Sorry for the lengthy post, just wanted to be clear about what I am
trying to accomplish! Any help is much appreciated.