Went back and forth a bit trying to find out the easiest way to do this.
Found a plugin but it didn’t seem very stable/well written.
This is what I have going right now:
- if @content_for_recipe_editor_tabs
= yield :recipe_editor_tabs
= tabbed_navigator(RecipesController.send “edit_tabs”)
If any templates/sub-templates/partials used in this render have
- content_for(‘recipe_editor_tabs’ ) do
= tabbed_navigator(RecipesController.send “new_tabs”)
That content will be used in place of the content specified in the else
Here’s what new_tabs and edit_tabs looks like.
[tab(“Description”, :new_ingredient_path, :needs => [:recipe])]
This will likely abstract a little more as we add more views that need
tabbed_navigators, but I’ll hold off on that to see where the repetition
‘tabbed_navigator’ helper takes the array of tabs and renders them as an
with links. Highlighting rules are currently done with a current_page?
tab(name, url_for_method, options) Returns a Hash with greater verbosity
Right now this looks like the simplest way to do things. I looked a bit
And had some trouble installing it and using it.
Does anybody know of any other easy solutions to this issue?