Tabnav retires, enter Widgets!

Posted by Paolo Sat, 18 Aug 2007 23:44:00 GMT

03 sep 07 UPDATE: see a few changes we’ve made to the new version reading this post!

Hi guys, I’m working on my RailsConfEurope presentation during these days. I decided to fix a few Tabnav issues and write a few more components we often use.

I ended up writing a new Rails plugin named Widgets. It aims to offer a consistent set of rails helpers which can help you insert nice components in your rails app with no effort at all.

It already contains a more flexible version of the Tabnav and a new Navigation widget (it allows you to define those little links you usually find in the top-right corner of webapps with the same powerful highlighting engine of the Tabnav).

I’m going to add more widgets before my speech in Berlin, so don’t consider this plugin as final. I’d like you to try this out and give me feedback…

just run:

ruby script/plugin install svn://svn.seesaw.it/widgets/trunk

and then run the tabnav generator:

ruby script/generate tabnav

or the navigation one…

ruby script/generate navigation

They should give you all the info you need to get started by yourself. Please send us feedback via email at staff@seesaw.it. We’re currently experiencing issues with the comment spam system, I promise we’ll fix it asap!

Thanks for reading.

Posted in  | Tags , , , ,  | 8 comments | no trackbacks

Trackbacks

Use the following link to trackback from your own site:
http://blog.seesaw.it/articles/trackback/206518

Comments

  1. Avatar Dave said 15 days later:

    Great plugin!

    Can you clarify how the highlighting and custom html features can be used? I dug around in the code to determine that I can do this:

    add_tab do |t| ... t.html= { :id => ‘tab_home’ } end

    to get id=”tab_home” on my Home tab. However, this is not really documented (unless I missed it), so there may be more to it.

    Also, what is the best way to get the highlighting to work? It seems to work “automatically” in some cases, but in others (i.e. clicking from tab to tab on the page) it will not accurately highlight any tab, or will highlight the wrong one. I’ve let the highlighting work by itself, and also tried manual highlighting using “highlights_on” as defined in the module Widgets::Highlightable.

    I’m assuming this is due to a mistake I’ve made, but I’m wondering if you could clarify the usage in the docs so I can see what I did wrong?

    Thanks! -dave

  2. Avatar glenn.west@aarcorp.com said 15 days later:

    Ok pulled in the “widgets” Now my app is dieying. Is there a new “rhtml” tag needed?

    ActionView::ActionViewError in Account#login Showing app/views/layouts/login.rhtml where line #9 raised:

    No rhtml, rxml, rjs or delegate template found for widgets/_login_tabnav in ./script/../config/../app/views

    Extracted source (around line #9):

    6: 7: 8: 9: <%= start_tabnav :login %> 10: 11: <%= @content_for_layout %> 12:

    RAILS_ROOT: ./script/../config/..

    Application Trace | Framework Trace | Full Trace c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:399:in `find_template_extension_for’ c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:335:in `pick_template_extension’ c:/ruby/lib/ruby/gems/1.8/gems/ Show session dump

    - :return_to: / flash: !map:ActionController::Flash::FlashHash {}

    Response Headers: {“Status”=>”200 OK”, “cookie”=>[], “Cache-Control”=>”no-cache”}

  3. Avatar djwonk said 17 days later:

    I just found the (old) tabnav plugin a few days ago. I thought it was great, but had a few minor aesthetic flaws. For example, I didn’t like the main_tabnav.rb file living in my models directory, since it wasn’t really a model like the others.

    Just today I found the (new) widgets plugin. You are right, it is much more Ruby-esque. Good job. I got it working in only a few minutes.

    I read your blog and like how you implemented the ‘if’ functionality.

    Thanks for sharing this with the community.

  4. Avatar Hans said 29 days later:

    I just switched from the old tabnav to the new one and I really like it.

    I has just one problem. When no tab is selected I would like to display just the tabs without any main_tabnav_content. In my application two empty rows of content are displayed below the tabs. How to get rid of that ?

  5. Avatar Paolo said 31 days later:

    Hans, do you mean a boxed tabnav? you can pass tabnav method a block it will render a box with content underneath tabs, otherwise it will not.

    So just try with <%= tabnav :main %> instead of <% tabnav :main do ... end%>.

  6. Avatar sgarza said 101 days later:

    are there examples of this?

  7. Avatar caoweiyuan@gmail.com said 116 days later:

    Greate UI plugin! go on good job.

  8. Avatar primary0 said 225 days later:

    how can i have a tab wrapped in a custom css div (with inner spans – for image rounded corners and so forth).

Comments are disabled


SeeSaw srl - Via Monte Pasubio, 8 37126 Verona - tel +39 045 4857457 fax 045 4851151 P.Iva 03609790237