Class: InlineForms::Tabs::TabsBuilder
Overview
Instance Method Summary
collapse
Methods inherited from Builder
#current_tab?, #initialize
Instance Method Details
#close_tabs(_options = {}) ⇒ Object
170
171
172
|
# File 'lib/inline_forms/tabs.rb', line 170
def close_tabs(_options = {})
"</ul>".html_safe
end
|
#open_tabs(options = {}) ⇒ Object
166
167
168
|
# File 'lib/inline_forms/tabs.rb', line 166
def open_tabs(options = {})
@context.tag("ul", options, true)
end
|
#tab_for(tab, name, url_options, item_options = {}) ⇒ Object
154
155
156
157
158
159
160
161
162
163
164
|
# File 'lib/inline_forms/tabs.rb', line 154
def tab_for(tab, name, url_options, item_options = {})
if current_tab?(tab)
item_options[:class] = item_options[:class].to_s.split(" ")
.push(@options[:active_class] || "current")
.join(" ")
end
content = @context.link_to_unless(current_tab?(tab), name, url_options) do
@context.content_tag(:span, name)
end
@context.content_tag(:li, content, item_options)
end
|