What I am trying to achieve is to create a sidebar exactly like the one
on the left of this forum, but instead of showing all the links, there
would be a ‘+’ sign next to each heading where you can click to see the
links for that section. I am thinking render :partial is the best way to
do this but I’m not sure the best way to implement it.
My assumptions are:
-
I need a file ‘sidebar.rhtml’ that is rendered in a forum page. This
file will have the list of headings and link_to_remote calls into the
forum controller. -
In the forum controller I need a function along the lines of
‘expand_list’ which then calls render :partial for a given list (can I
base which list is used on the :id param from the link_to_remote call?
if so how?). Each list will have a partial file - i.e. _list1.rhtml,
_list2.rhtml, … -
In the ‘forum’ subfolder of views I should have each of the partials
and they will look like this:
Does this sound correct? Am I missing anything? I tried to do the above
but kept getting parse errors when rendering the partials. Can someone
give me an example of how I should setup sidebar.rhtml to do the
link_to_remote calls? I am confused about how I should be using the
:update parameter and also :id if it is needed.
Thanks,
-Alex