Hi: I''m trying to get a page setup with the left side having a collapsable javascript menu (built from the database) and the right side having more data about each node in the tree... very standard actually. I figured frames would be a good way to go, because as the tree expands as the user dives further in, the frame will add scroll bars without disrupting the left hand side. The problem I''m having is that I don''t understand how to structure this setup, how do I refer to the rhtml file? how do I get it loaded and parsed and the output in the Menu frame? I put the frame definitions in the layout file, as such: ------------ <html> <head> <title>Admin: <%= controller.action_name %></title> <%= stylesheet_link_tag ''scaffold'' %> </head> <frameset cols="25%,*"> <frame name="Menu" src="menu.html" frameborder="1" scrolling="auto"></frame> <frame name="Body" src="body.html"></frame> </frameset> </html> ------------ -- Posted via http://www.ruby-forum.com/.
Hi Andrew ~ I try to avoid frames like the plague. Maybe RJS templates might work better for your application. ~ Ben''s 2 cents ~ On 5/1/06, Andrew Gibson <gibson_andrew@yahoo.com> wrote:> Hi: > > I''m trying to get a page setup with the left side having a collapsable > javascript menu (built from the database) and the right side having more > data about each node in the tree... very standard actually. > > I figured frames would be a good way to go, because as the tree expands > as the user dives further in, the frame will add scroll bars without > disrupting the left hand side. > > The problem I''m having is that I don''t understand how to structure this > setup, how do I refer to the rhtml file? how do I get it loaded and > parsed and the output in the Menu frame? > > I put the frame definitions in the layout file, as such: > ------------ > <html> > <head> > <title>Admin: <%= controller.action_name %></title> > <%= stylesheet_link_tag ''scaffold'' %> > </head> > > <frameset cols="25%,*"> > <frame name="Menu" src="menu.html" frameborder="1" > scrolling="auto"></frame> > <frame name="Body" src="body.html"></frame> > </frameset> > </html> > ------------ > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Ben Reubenstein 303-947-0446 http://www.benr75.com
Just reference the controllers that you want to use to populate the frames in the src attributes. Here''s a frameset that I use: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3c.org/TR/REC-html40/strict.dtd"> <html lang="en"> <head> <%= stylesheet_link_tag ''store'', ''admin'', :media => ''all'' %> <% @page_title ||= ''Site Administration'' -%> <title>Admin | <%= @page_title %></title> </head> <frameset rows="90,*"> <frame src="/admin/banner" scrolling="no" /> <frameset cols="250,*"> <frame src="/admin/treeview?nobanner=true" /> <frame name="main" /> </frameset> </frameset> </html> Andrew Gibson wrote:> Hi: > > I''m trying to get a page setup with the left side having a collapsable > javascript menu (built from the database) and the right side having more > data about each node in the tree... very standard actually. > > I figured frames would be a good way to go, because as the tree expands > as the user dives further in, the frame will add scroll bars without > disrupting the left hand side. > > The problem I''m having is that I don''t understand how to structure this > setup, how do I refer to the rhtml file? how do I get it loaded and > parsed and the output in the Menu frame? > > I put the frame definitions in the layout file, as such: > ------------ > <html> > <head> > <title>Admin: <%= controller.action_name %></title> > <%= stylesheet_link_tag ''scaffold'' %> > </head> > > <frameset cols="25%,*"> > <frame name="Menu" src="menu.html" frameborder="1" > scrolling="auto"></frame> > <frame name="Body" src="body.html"></frame> > </frameset> > </html> > -------------- Posted via http://www.ruby-forum.com/.
Andrew Gibson wrote:> Hi: > > I''m trying to get a page setup with the left side having a collapsable > javascript menu (built from the database) and the right side having more > data about each node in the tree... very standard actually. > > I figured frames would be a good way to go, because as the tree expands > as the user dives further in, the frame will add scroll bars without > disrupting the left hand side. > > The problem I''m having is that I don''t understand how to structure this > setup, how do I refer to the rhtml file? how do I get it loaded and > parsed and the output in the Menu frame?There''s a <frameset> answer from Mick Sharpe, but I thought I''d suggest going with a single-page solution. I think it''s cleaner, but I''ve been known to have some pretty funny ideas about this sort of thing :-) You can have a fixed-width div with scrollbars like this: <body> <div id=''menu'' style=''width: 200px; overflow: scroll''> <%= render_menu %> </div> <div id=''content''> <%= render_content %> </div> </body> No need for frames at all :-) -- Alex