Module: RenderSortableTreeHelper::Render
- Defined in:
- app/helpers/render_sortable_tree_helper.rb
Class Attribute Summary collapse
-
.h ⇒ Object
Returns the value of attribute h.
-
.options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Class Attribute Details
.h ⇒ Object
Returns the value of attribute h.
12 13 14 |
# File 'app/helpers/render_sortable_tree_helper.rb', line 12 def h @h end |
.options ⇒ Object
Returns the value of attribute options.
12 13 14 |
# File 'app/helpers/render_sortable_tree_helper.rb', line 12 def @options end |
Class Method Details
.children ⇒ Object
54 55 56 57 58 |
# File 'app/helpers/render_sortable_tree_helper.rb', line 54 def children unless [:children].blank? "<ol class='nested_set'>#{ [:children] }</ol>" end end |
.controls ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'app/helpers/render_sortable_tree_helper.rb', line 40 def controls node = [:node] edit_path = h.url_for(:controller => 'admin/properties', :action => :edit, :id => node) destroy_path = h.url_for(:controller => 'admin/properties', :action => :destroy, :id => node) " <div class='controls'> #{ h.link_to '', edit_path, :class => :edit } #{ h.link_to '', destroy_path, :class => :delete, :method => :delete, :data => { :confirm => 'Are you sure?' } } </div> " end |
.render_node(h, options) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/helpers/render_sortable_tree_helper.rb', line 14 def render_node(h, ) @h, @options = h, node = [:node] " <li data-node-id='#{ node.id }'> <div class='item'> <i class='handle'></i> #{ show_link } #{ controls } </div> #{ children } </li> " end |
.show_link ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'app/helpers/render_sortable_tree_helper.rb', line 30 def show_link node = [:node] ns = [:namespace] url = h.url_for(:controller => 'admin/properties', :action => :show, :id => node) # url = h.url_for(ns + [node]) title_field = node[:name] #p options "<h4>#{ h.link_to(title_field, url) }</h4>" end |