Class: JquerySortableTreeHelper::RenderNestedOptionsHelper::Render
Instance Attribute Summary
#h, #options
Instance Method Summary
collapse
#controls, #div_item, #edit_link, #handle, #initialize, #node, #show_link, #show_path
Instance Method Details
#children ⇒ Object
8
9
10
|
# File 'app/helpers/jquery_sortable_tree_helper/render_nested_options_helper.rb', line 8
def children
@options[:children].html_safe
end
|
#render_node ⇒ Object
4
5
6
|
# File 'app/helpers/jquery_sortable_tree_helper/render_nested_options_helper.rb', line 4
def render_node
@h.content_tag(:option, options[:node].send(options[:title]), tag_options) + children
end
|
#tag_options ⇒ Object
12
13
14
15
16
17
18
19
20
|
# File 'app/helpers/jquery_sortable_tree_helper/render_nested_options_helper.rb', line 12
def tag_options
opts = { class: "l_#{@options[:level]}", value: @options[:node][:id] }
if @options[:selected] == @options[:node]
opts[:class] += ' selected'
opts[:selected] = :selected
end
opts
end
|