Sha256: 8cf975fb96afde8c39b4a04d41db9a6e323413a01f956ae8ac6b7c13f7eb1f9d

Contents?: true

Size: 646 Bytes

Versions: 7

Compression:

Stored size: 646 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")
        ActiveSupport::Deprecation.warn("Using content_for(:#{name}_toolbar) is deprecated. Please use toolbar(:#{name}) instead.")
        content_for(:"#{name}_toolbar")
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
trestle-0.9.8 app/helpers/trestle/toolbars_helper.rb
trestle-0.9.7 app/helpers/trestle/toolbars_helper.rb
trestle-0.9.6 app/helpers/trestle/toolbars_helper.rb
trestle-0.9.5 app/helpers/trestle/toolbars_helper.rb
trestle-0.9.4 app/helpers/trestle/toolbars_helper.rb
trestle-0.9.3 app/helpers/trestle/toolbars_helper.rb
trestle-0.9.2 app/helpers/trestle/toolbars_helper.rb