Sha256: 698bcbb7304d2165c89d7b035bf6be6b213af86b496e680c3447972d91a09ce6
Contents?: true
Size: 1.05 KB
Versions: 1
Compression:
Stored size: 1.05 KB
Contents
module Spurs module Nav module Helper # Build a navigation # :type can be either :pills or :tabs # :style applies to ul def spurs_nav(options={ }, &block) opts = Spurs::Nav::nav_default_options.merge(options) if !opts[:builder] raise "Null builder" end opts_to_pass_to_builder = {} if opts[:dynamic] opts_to_pass_to_builder[:dynamic] = opts[:dynamic] end if !opts[:type].in? [:pills,:tabs,:list] Rails.logger.debug("WARNING: unknown spurs_nav flavor. Using tabs instead") opts[:type] = :tabs end nav_builder = opts[:builder].new(opts_to_pass_to_builder) output = capture(nav_builder, &block) ul_args = { :class => "nav nav-#{opts[:type]} #{opts[:stacked] ? "nav-stacked" : ""} #{opts[:class] ? opts[:class] : ""}" } if defined?(opts[:style]) then ul_args[:style] = opts[:style] end content_tag_string(:ul, output, ul_args) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
spurs-0.0.1 | lib/spurs/nav/helper.rb |