Skip to content

Instantly share code, notes, and snippets.

@chrismear
Created June 22, 2009 15:46
Show Gist options
  • Save chrismear/134031 to your computer and use it in GitHub Desktop.
Save chrismear/134031 to your computer and use it in GitHub Desktop.
# Use in conjunction with the tab helper to create a list of tabs
#
# For example:
#
# <% tab_list do -%>
# <%= tab "Photos", campaign_photos_path(:campaign_id => @campaign), "campaign_photos", :selected %>
# <%= tab "Videos", campaign_videos_path(:campaign_id => @campaign), "campaign_videos" %>
# <%= tab "Information", campaign_information_path(:campaign_id => @campaign), "campaign_information" %>
# <% end -%>
def tab_list(id=nil, &block)
options = {:class => "ui-tabs-nav"}
options[:id] = id.to_s if id
content = capture(&block)
concat(tag(:ul, options, true))
concat(content)
concat("</ul>")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment