Forum: Ruby on Rails RE: Existing Tabs Helper?

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.
F3b7b8756d0c7f71cc7460cc33aefaee?d=identicon&s=25 Berger, Daniel (Guest)
on 2006-05-03 18:57
(Received via mailing list)
> javascript/css.
> Stephan

I'm not positive what the OP is referring to, but I'd like some sort
of plugin where my views show up as tabs on a page that users
could click on for easier navigation.

Does something like that exist?

Thanks,

Dan


This communication is the property of Qwest and may contain confidential
or
privileged information. Unauthorized use of this communication is
strictly
prohibited and may be unlawful.  If you have received this communication
in error, please immediately notify the sender by reply e-mail and
destroy
all copies of the communication and any attachments.
8540479bbacb4ab1bc5f6c6e13f90094?d=identicon&s=25 Stephan Wehner (Guest)
on 2006-05-03 18:57
(Received via mailing list)
The havoc tabs are really easy to use, but depend on javascript and css
being available.

See http://www.havocstudios.com/articles/ajax/ajax_tabs/

In essence, here is your "index" page:

<html>
	<head>
		<title>havocStudios: Ajax Tabs Demo</title>
		<style type="text/css" media="screen">@import "tabs.css";</style>
		<script src="ajax.js" type="text/javascript"></script>
		<script src="tabs.js" type="text/javascript"></script>

		<script type="text/javascript">
			function doOnLoad() {
				OpenTab("tab_page1", "Page 1", "page1.html", false, '');
			}
		</script>
	</head>

	<body onload="doOnLoad()">
		<div id="tabContainer">
			<div id="tabs">
				<ul id="tabList">
				</ul>
			</div>
			<div id="tabPanels"></div>
		</div>

	</body>
</html>

Then you add lines OpenTab(......) for all the views that you like.

But it doesn't work well when there are too many tabs.

So if you can get a handle on the available views, you could add
methods/fields to their controllers to fill in the OpenTab paramaters
for the tab (viewname, title, can be closed, colour,...),
and that would be what you are looking for: collect that information in
another index view. and produce the HTML from above, with the OpenTab
lines.
But maybe that doesn't need to be automated. Adding the required lines
manually, and placing the file in the public folder should be enough.
The Havoc tabs also allow opening new tabs later on, closing them, ...

If you don't want to rely on javascript, I don't know.

Stephan
This topic is locked and can not be replied to.