Alex Ciarlillo
2007-Sep-07 01:00 UTC
Can someone help me with ''render partial'' from a link?
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: 1) 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. 2) 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, ... 3) In the ''forum'' subfolder of views I should have each of the partials and they will look like this: <div id=''list1''> <ul> <li><a href="/forum/1">Forum 1</a></li> <li><a href="/forum/2">Forum 2</a></li> </ul> </div> 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---