Forum: Ruby on Rails Rails and Framesets

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6967418e1ae7f0aaa64a6689a401d9dd?d=identicon&s=25 Craig Mcdonnell (craigmcdonnell)
on 2006-06-06 03:05
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.
6967418e1ae7f0aaa64a6689a401d9dd?d=identicon&s=25 Craig Mcdonnell (craigmcdonnell)
on 2006-06-06 03:13
Oh, I'm trying to specify the frameset in application.rhtml in the
layouts dir.

The frameset is roughly as follows:

<frameset>
  <frame name="nav_pane" src="??" scrolling=yes>
  <framset id=data_wrapper rows="*,*" frameborder=yes framespacing=5>
    <frame name="top_pane" src="??" scrolling=yes>
    <frame name="bottom_pane" src="??" scrolling=no>
  </frameset>
</frameset>
F59179b40744bfa1e9f77c16bbc3341f?d=identicon&s=25 Jamie Quint (Guest)
on 2006-06-06 03:15
(Received via mailing list)
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
6967418e1ae7f0aaa64a6689a401d9dd?d=identicon&s=25 Craig Mcdonnell (craigmcdonnell)
on 2006-06-06 03:50
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?
E28c35323f624b8b9ed8712e25105454?d=identicon&s=25 Ray Baxter (Guest)
on 2006-06-06 07:47
(Received via mailing list)
Craig McDonnell wrote:
>   </frameset>
> </frameset>
>

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

<frameset>
   <frame name="nav_pane" src="/nav" scrolling=yes>
   <framset id=data_wrapper rows="*,*" frameborder=yes framespacing=5>
     <frame name="top_pane" src="/data/list" scrolling=yes>
     <frame name="bottom_pane" src="/data/summary" scrolling=no>
   </frameset>
</frameset>

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

--

Ray
4d8b13b54ae2fabfffd5537b04c7369c?d=identicon&s=25 Scott Fortmann-Roe (Guest)
on 2006-06-06 12:36
(Received via mailing list)
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
This topic is locked and can not be replied to.