Tabnav: Do We Really Need a Plugin for Tabbed Navigation?
by Paolo Dona
Tabnav: Do We Really Need a Plugin for Tabbed Navigation? by Paolo Dona
"will code for food"
why rails?
speed!
leaving
more time for conversation with customers
more time for interface design
traditionally
40% time design
60% code
with rails
70% design
30% code
Design/Navigation
tabbed navigation links
tabs everywhere!!!
TABNAV
ruby script/generate tabnav <tabname>
in the views:
< %= tabnav :tabname %>
auto-generate partials
note: Tabnav auto-magically finds your controllers and by default it creates a “tab” for every controller
nested tabs
ajax calls
dynamic attributes
highlighting rules
define which tabs get highlighted and when it happens
CSS customization
key points about tabnav and widgets in general
- easy and readable
- quick to setup
- no monkey business (no html or css!)
NAVIGATION
ruby ./script/generate navigation <nav_name>
in the views
< %= navigation <nav_name %>
(no cluttering of the views!)
SHOWHIDE
typical hide/show div for object details
< %= show_detail_for user%>
TABLEIZER
start from a collection!
< %= tableize :customers, @customers,
:header => 'xxx'
:generate_css => yes %>
use partials
< %= tableize :customers, @customers,
:partial => 'xxx'%>
TOOLTIPS
< %= tooltip image_tag('imagenmae') do
xxxx tooltip zzzzz
end
%>
COLUMN LAYOUTS
column_layout :columns => 3 do
add_part do
end
...
add_part do
end
end
NUBBINS
define sensible areas
with_nubbin_for(item) do
...
end
DON’T BE A CODE MONKEY!!
http://www.seesaw.it http://blog.seesaw.it