class Aerogel::Admin::TabsBuilder
TabsBuilder
constructs and displays a tab navigation. from passed object.
Example:
tabs do tab "/url/to/page1", label: "Page 1" tab "/url/to/page2", label: "Page 2" end
Constants
- DEFAULT_OPTIONS
Attributes
options[RW]
style[RW]
tabs[RW]
Public Class Methods
new( options = {}, &block )
click to toggle source
Calls superclass method
# File lib/aerogel/admin/tabs_builder.rb, line 20 def initialize( options = {}, &block ) super( &block ) self.options = DEFAULT_OPTIONS.deep_merge( options ) self.style = self.options[:style] self.tabs = [] end
Public Instance Methods
tab( *args, &block )
click to toggle source
# File lib/aerogel/admin/tabs_builder.rb, line 27 def tab( *args, &block ) self.tabs << Tab.new( *args, &block ) nil end
template( name )
click to toggle source
# File lib/aerogel/admin/tabs_builder.rb, line 32 def template( name ) "admin/tabs_builder/#{style}/#{name}".to_sym end
wrap( content )
click to toggle source
# File lib/aerogel/admin/tabs_builder.rb, line 36 def wrap( content ) erb template("tabs.html"), locals: { tabs: self }, layout: false end