Sha256: 0f7f4ec7bdec9568448cbee1140cb57eee40fac134dbe8e3f1a19494b0b6aa68

Contents?: true

Size: 638 Bytes

Versions: 3

Compression:

Stored size: 638 Bytes

Contents

module Trestle
  module ToolbarsHelper
    def render_toolbar(toolbar, *args)
      result = toolbar.groups(self, *args).map do |items|
        if items.many?
          content_tag(:div, class: "btn-group", role: "group") do
            safe_join(items, "\n")
          end
        else
          items.first
        end
      end

      safe_join(result, "\n")
    end

    def deprecated_toolbar(name)
      if content_for?(:"#{name}_toolbar")
        Trestle.deprecator.warn("Using content_for(:#{name}_toolbar) is deprecated. Please use toolbar(:#{name}) instead.")
        content_for(:"#{name}_toolbar")
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
trestle-0.10.0 app/helpers/trestle/toolbars_helper.rb
trestle-0.10.0.pre2 app/helpers/trestle/toolbars_helper.rb
trestle-0.10.0.pre app/helpers/trestle/toolbars_helper.rb