Class: JquerySortableTreeHelper::RenderIndentedOptionsHelper::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
22
23
24
|
# File 'app/helpers/jquery_sortable_tree_helper/render_indented_options_helper.rb', line 22
def children
@options[:children].html_safe
end
|
#render_node ⇒ Object
4
5
6
|
# File 'app/helpers/jquery_sortable_tree_helper/render_indented_options_helper.rb', line 4
def render_node
h.content_tag(:option, 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_indented_options_helper.rb', line 12
def tag_options
html_options = { value: node.id }
if options[:selected] == node
html_options[:selected] = 'selected'
html_options[:class] = 'selected'
end
html_options
end
|
#title ⇒ Object
8
9
10
|
# File 'app/helpers/jquery_sortable_tree_helper/render_indented_options_helper.rb', line 8
def title
"\u202f" * (@options[:spacing] || 3).to_i * (@options[:level]-1) + node.send(@options[:title])
end
|