Using HTML frames with rails


#1

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:

Admin: <%= controller.action_name %> <%= stylesheet_link_tag 'scaffold' %> ------------

#2

Just reference the controllers that you want to use to populate the
frames in the src attributes. Here’s a frameset that I use:

<%= stylesheet_link_tag 'store', 'admin', :media => 'all' %> <% @page_title ||= 'Site Administration' -%> Admin | <%= @page_title %>

Andrew G. 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:

Admin: <%= controller.action_name %> <%= stylesheet_link_tag 'scaffold' %> ------------

#3

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 G. removed_email_address@domain.invalid wrote:

The problem I’m having is that I don’t understand how to structure this


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


Ben R.
303-947-0446
http://www.benr75.com


#4

Andrew G. wrote:

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 answer from Mick S., 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 :slight_smile:

You can have a fixed-width div with scrollbars like this:

<%= render_menu %>
<%= render_content %>

No need for frames at all :slight_smile: