Posted by Paolo
Mon, 24 Jul 2006 01:09:00 GMT
UPDATE Feb 01, 2007: the Tabnav has been updated in order to work wit Rails 1.2, read this post fom more info.
Hi guys, during our development efforts we needed tabbed navigations. Well, after struggling with the acts_as_wizard plugin (you can find it in the toolbox) we decided to implement yet another rails plugin, and we think this time it’s even easier to use and someway plain cool.
Tabnav it’s so far the easiest way to build tabbed navigation like this:

The Tabnav Rails plugin provides nice tabbed navigation out of the box
All this magic it’s done by this fragment of code put inside my layout:
<%= start_tabnav :main %>
<%= @content_for_layout %>
<%= end_tabnav %>
Sounds cool? keep reading…
Socialize it:
Read more...
Posted in Web, Ruby + Rails, Tips & Tricks | Tags plugin, Ruby On Rails, tabnav, toolbox | 107 comments | no trackbacks
Posted by Paolo
Tue, 18 Jul 2006 04:58:00 GMT
Our acts_as_wizard plugin needed improvements to address a few needs
of an application we’re currently working on. I promised improvements to a bunch of early adopters too so finally I took my time and have done this dirty work.
If you don’t know acts_as_wizard yet, you just need to know
it’s a rails plugin to help you build clean and simple web wizards.
You can find acts_as_wizard articles, installation instructions, tutorials and previous posts in the SeeSaw’s toolbox.
A Wizard can be simply defined this way:
class CreateCatAndDogWizard < Wizard::Base
add_step do
named 'Insert your cat'
controlled_by :cats
enable_actions :new, :create
add_rewrite({:action => 'list'},
{:controller => 'dogs', :action => 'new'})
end
add_step do
named 'Insert your dog'
controlled_by :dogs
enable_actions :new, :create
add_rewrite({:action => 'list'},
{:controller => 'main', :action => 'finished'})
end
add_step do
named 'Finished!'
controlled_by :main
enable_actions :finished
end
end
The main areas our refactoring focused on are:
- get rid of every controller contamination: we wanted controllers to be totally unaware of being part of a wizard.
- multi wizard support: the same controller must be able to take part of different wizards.
- general code cleanup: well, we just were ashamed of some dirty code..
If you’ve never uses acts_as_wizard, you don’t need to read what follows, just remember it has gotten better :)
If you were an early adopter instead, keep reading an I’ll show you what technically has changed…
Socialize it:
Read more...
Posted in Web, Ruby + Rails, Tips & Tricks | Tags acts_as_wizard, plugin, Ruby On Rails, refactoring, toolbox | 6 comments | no trackbacks