# Rails and Framesets

**URL:** <https://www.ruby-forum.com/t/rails-and-framesets/62553>\
**Category:** Rails\
**Created:** [June 6, 2006, 3:05am UTC](https://www.ruby-forum.com/t/rails-and-framesets/62553 "2006-06-06T03:05:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigtmackenzie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3d9bf3/32.png) [@craigtmackenzie](https://www.ruby-forum.com/u/craigtmackenzie)\
**Post date:** [June 6, 2006, 3:05am UTC](https://www.ruby-forum.com/t/rails-and-framesets/62553/1 "2006-06-06T03:05:04Z")

</div>

I’d like to use a frameset to separate the content in an app I’m playing  
with into 3 separate panes. A 1/3 page width left pane will be for  
general navigation, (so rarely needs reloading). The main content  
separates into a top and bottom pane, (with the top pane being set by  
the nav pane, and the bottom pane being set by the top pane).

Unfortunately, I’m new to Rails and haven’t the faintest idea how I can  
get Rails to parse the frame content for each pane! Can anyone offer any  
suggestions?

Thanks.

---

<div class="post-metadata">

**Author:** ![craigtmackenzie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3d9bf3/32.png) [@craigtmackenzie](https://www.ruby-forum.com/u/craigtmackenzie)\
**Post date:** [June 6, 2006, 3:13am UTC](https://www.ruby-forum.com/t/rails-and-framesets/62553/2 "2006-06-06T03:13:56Z")

</div>

Oh, I’m trying to specify the frameset in application.rhtml in the  
layouts dir.

The frameset is roughly as follows:

---

<div class="post-metadata">

**Author:** ![craigtmackenzie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3d9bf3/32.png) [@craigtmackenzie](https://www.ruby-forum.com/u/craigtmackenzie)\
**Post date:** [June 6, 2006, 3:15am UTC](https://www.ruby-forum.com/t/rails-and-framesets/62553/3 "2006-06-06T03:15:19Z")

</div>

It would probably be a lot easier to use CSS to make the data appear  
where you want it to. It isn’t too hard to use css to do a 3 panel  
setup, easier than frames and more modern. A book I found good for  
learning basic CSS is “Stylin’ with CSS”. You may want to check that  
out.

~Jamie

---

<div class="post-metadata">

**Author:** ![craigtmackenzie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3d9bf3/32.png) [@craigtmackenzie](https://www.ruby-forum.com/u/craigtmackenzie)\
**Post date:** [June 6, 2006, 3:50am UTC](https://www.ruby-forum.com/t/rails-and-framesets/62553/4 "2006-06-06T03:50:11Z")

</div>

Yeah, I’m sure you’re right. Unfortunately, I’m pretty new to CSS too -  
I usually leave the UI stuff to professional designers! Also, I’m just  
playing with Rails at the moment.

I did manage to get something working by adding a ‘Nav’ controller with  
a ‘boot’ method. The associated .rhtml file then sets the src attrib. of  
each frame using url\_for.

Is this an abuse of MVC or Rails?

---

<div class="post-metadata">

**Author:** ![craigtmackenzie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3d9bf3/32.png) [@craigtmackenzie](https://www.ruby-forum.com/u/craigtmackenzie)\
**Post date:** [June 6, 2006, 7:47am UTC](https://www.ruby-forum.com/t/rails-and-framesets/62553/5 "2006-06-06T07:47:16Z")

</div>

Craig McDonnell wrote:

> 

Does your question boil down to what to replace “???” with?

Replace them with the urls (absolute or relative) of the thing being  
framed. So assuming a nav controller with an index view and a data  
controller with list and summary views, you’d have

The links in the frames could do the normal html tricks like targeting  
other frames, etc.

–

Ray

---

<div class="post-metadata">

**Author:** ![craigtmackenzie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3d9bf3/32.png) [@craigtmackenzie](https://www.ruby-forum.com/u/craigtmackenzie)\
**Post date:** [June 6, 2006, 12:36pm UTC](https://www.ruby-forum.com/t/rails-and-framesets/62553/6 "2006-06-06T12:36:16Z")

</div>

you can also communicate across frames using javascript if you need to  
do ajaxy stuff:

you can access any other frame by name and call a function in it. The  
folllowing assumes you aren’t using nest frames:  
window.parent.frames[‘targetframename’].ajaxyfunction()

-Scott
