Class: JquerySortableTreeHelper::RenderNestedOptionsHelper::Render
- Inherits:
-
Object
- Object
- JquerySortableTreeHelper::RenderNestedOptionsHelper::Render
- Defined in:
- app/helpers/jquery_sortable_tree_helper/render_nested_options_helper.rb
Instance Attribute Summary collapse
-
#h ⇒ Object
Returns the value of attribute h.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #children ⇒ Object
-
#initialize(h, options) ⇒ Render
constructor
A new instance of Render.
- #render_node ⇒ Object
- #tag_options ⇒ Object
Constructor Details
#initialize(h, options) ⇒ Render
Returns a new instance of Render.
6 7 8 |
# File 'app/helpers/jquery_sortable_tree_helper/render_nested_options_helper.rb', line 6 def initialize(h, ) @h, @options = h, end |
Instance Attribute Details
#h ⇒ Object
Returns the value of attribute h.
4 5 6 |
# File 'app/helpers/jquery_sortable_tree_helper/render_nested_options_helper.rb', line 4 def h @h end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'app/helpers/jquery_sortable_tree_helper/render_nested_options_helper.rb', line 4 def @options end |
Instance Method Details
#children ⇒ Object
14 15 16 |
# File 'app/helpers/jquery_sortable_tree_helper/render_nested_options_helper.rb', line 14 def children @options[:children].html_safe end |
#render_node ⇒ Object
10 11 12 |
# File 'app/helpers/jquery_sortable_tree_helper/render_nested_options_helper.rb', line 10 def render_node @h.content_tag(:option, [:node].send([:title]), ) + children end |
#tag_options ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'app/helpers/jquery_sortable_tree_helper/render_nested_options_helper.rb', line 18 def opts = { class: "l_#{@options[:level]}", value: @options[:node][:id] } if @options[:selected] == @options[:node] opts[:class] += ' selected' opts[:selected] = :selected end opts end |