If you need tabbed navigation on your pages (well who doesn’t?
) please read on about cool plugin for Rails. It’s work of Italian guy named Paolo Dona. Documentation is a bit scarce, especially for me. But Paolo helped me himself to get it working.
Lately plugin is a part of this widgets collection. It appears as if you have three choices when installing this plugin.
1. SVN
2. Git
3. Manual plugin install
Well, you don’t, and it costed me a couple of hours to figure out that SVN is not working since it’s not supported by Paolo anymore. For Git you need to do this:
$ cd
$ cd vendor/plugins
$ git clone git@github.com:paolodona/rails-widgets.git
It did not work for me. I think it’s related to firewall issues, but since I am new to Git I didn’t investigate a lot. Third and bullet-proof method is to manually download files, extract it to plugin folder, rename it to let’s say widgeds, and then apply
rake widgets:setup
From then on it should work. You need to twaek your tabs.css file, here is what I’ve ended up with.
.main_tabnav {
background-color: #FFFFFF;
padding: 5px;
height: 2em;
font-size: 10pt;
}
.main_tabnav ul {
height: 2em;
margin: 0;
padding: 0;
}
.main_tabnav li {
display: inline;
line-height: 1.167em;
padding: 0;
}
.main_tabnav li.secondary {
float: right;
}
.main_tabnav li a {
background:#5ec998;
color: #ebebeb;
text-decoration: none;
border: 0.083em solid #FFFFFF;
border-bottom: 0.083em solid #5ec998;
padding: 0.5em 0.667em 0.417em 0.5em;
float: left;
}
.main_tabnav li a.active {
color: #ebebeb;
font-weight: bold;
background:#004000;
border: 0.083em solid #FFFFFF;
border-bottom: 0.083em solid #004000;
}
.main_tabnav li a:hover {
color: #004000;
}
.main_tabnav li a.active:hover {
color: #ebebeb;
}
.main_tabnav_content {
background-color: #FFFFFF;
padding: 1.5em 0.417em;
}