# Using HTML frames with rails

**URL:** <https://www.ruby-forum.com/t/using-html-frames-with-rails/94358>\
**Category:** Rails\
**Created:** [May 1, 2006, 10:34pm UTC](https://www.ruby-forum.com/t/using-html-frames-with-rails/94358 "2006-05-01T22:34:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![esquilax](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e0b2c6/32.png) [@esquilax](https://www.ruby-forum.com/u/esquilax)\
**Post date:** [May 1, 2006, 10:34pm UTC](https://www.ruby-forum.com/t/using-html-frames-with-rails/94358/1 "2006-05-01T22:34:28Z")

</div>

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' %\> ------------

---

<div class="post-metadata">

**Author:** ![esquilax](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e0b2c6/32.png) [@esquilax](https://www.ruby-forum.com/u/esquilax)\
**Post date:** [May 1, 2006, 10:49pm UTC](https://www.ruby-forum.com/t/using-html-frames-with-rails/94358/2 "2006-05-01T22:49:02Z")

</div>

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' %\> ------------

---

<div class="post-metadata">

**Author:** ![esquilax](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e0b2c6/32.png) [@esquilax](https://www.ruby-forum.com/u/esquilax)\
**Post date:** [May 3, 2006, 6:58pm UTC](https://www.ruby-forum.com/t/using-html-frames-with-rails/94358/3 "2006-05-03T18:58:33Z")

</div>

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](mailto: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](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
Ben R.  
303-947-0446  
[http://www.benr75.com](http://www.benr75.com)

---

<div class="post-metadata">

**Author:** ![esquilax](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e0b2c6/32.png) [@esquilax](https://www.ruby-forum.com/u/esquilax)\
**Post date:** [May 3, 2006, 6:58pm UTC](https://www.ruby-forum.com/t/using-html-frames-with-rails/94358/4 "2006-05-03T18:58:41Z")

</div>

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 🙂

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

 \<%= render\_menu %\> 

 \<%= render\_content %\> 

No need for frames at all 🙂
