Sha256: 01a257d4740dc151ae62470c2ca2864739b39d64f23069d1dc204429f3a37163

Contents?: true

Size: 733 Bytes

Versions: 1

Compression:

Stored size: 733 Bytes

Contents

# DOC:
# We use Helper Methods for tree building,
# because it's faster than View Templates and Partials

# SECURITY note
# Prepare your data on server side for rendering
# or use h.html_escape(node.content)
# for escape potentially dangerous content
module JquerySortableTreeHelper
  module RenderExpandableTreeHelper
    class Render < JquerySortableTreeHelper::RenderSortableTreeHelper::Render
      attr_accessor :h, :options

      def initialize(h, options)
        @h, @options = h, options
      end

      def div_item
        h.content_tag(:div, handle + expand_button + edit_link + controls, class: :item)
      end

      def expand_button
        h.content_tag(:b, '+', class: 'expand plus')
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jquery_sortable_tree-3.0.0 app/helpers/jquery_sortable_tree_helper/render_expandable_tree_helper.rb