Module: RenderSortableTreeHelper::Render
- Defined in:
- app/helpers/render_sortable_tree_helper.rb
Class Attribute Summary collapse
-
.helper ⇒ Object
Returns the value of attribute helper.
-
.options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Class Attribute Details
.helper ⇒ Object
Returns the value of attribute helper.
4 5 6 |
# File 'app/helpers/render_sortable_tree_helper.rb', line 4 def helper @helper end |
.options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'app/helpers/render_sortable_tree_helper.rb', line 4 def @options end |
Class Method Details
.children ⇒ Object
28 29 30 31 32 |
# File 'app/helpers/render_sortable_tree_helper.rb', line 28 def children unless [:children].blank? [:children] end end |
.render_node(helper, options) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/helpers/render_sortable_tree_helper.rb', line 6 def render_node(helper, ) @helper, @options = helper, node = [:node] id_field = [:id] li_attr_field = [:li_attr] " <ul> <li id='#{ node.send(id_field) }' #{node.send(li_attr_field)} > #{ show_link } #{ children } </li> </ul> " end |
.show_link ⇒ Object
21 22 23 24 25 26 |
# File 'app/helpers/render_sortable_tree_helper.rb', line 21 def show_link node = [:node] title_field = [:title] a_attr_field = [:a_attr] "<a #{node.send(a_attr_field)}>#{node.send(title_field)}</a>" end |