class Tabulous::BaseRenderer
Public Class Methods
new(tabset, view)
click to toggle source
# File lib/tabulous/renderers/base_renderer.rb, line 6 def initialize(tabset, view) @view = view @tabset = tabset end
Public Instance Methods
tabs_html()
click to toggle source
all renderers need to have a tabs_html
method that returns the HTML to be embedded when the <%= tabs %> helper method is called
# File lib/tabulous/renderers/base_renderer.rb, line 13 def tabs_html raise "override me" end
Protected Instance Methods
tab_html(tab)
click to toggle source
# File lib/tabulous/renderers/base_renderer.rb, line 19 def tab_html(tab) raise "override me" end
tab_http_verb_attributes(tab)
click to toggle source
# File lib/tabulous/renderers/base_renderer.rb, line 35 def tab_http_verb_attributes(tab) return '' if tab.http_verb == :get %Q{data-method="#{tab.http_verb}"} end
tab_list_html()
click to toggle source
# File lib/tabulous/renderers/base_renderer.rb, line 23 def tab_list_html html = '' for tab in @tabset.primary_tabs html << tab_html(tab) end html end
tab_text(tab)
click to toggle source
# File lib/tabulous/renderers/base_renderer.rb, line 40 def tab_text(tab) tab.text(@view) end
tab_url(tab)
click to toggle source
# File lib/tabulous/renderers/base_renderer.rb, line 31 def tab_url(tab) tab.link_path(@view) end