Sha256: 432a4e3727e49c3ff0dd99948aa498312f42bb8eb488daf9b8b4776ab7067a0e

Contents?: true

Size: 438 Bytes

Versions: 62

Compression:

Stored size: 438 Bytes

Contents

module Workarea
  module JbuilderAppendPartials
    def append_partials(name, locals = {})
      appends = ::Workarea::Plugin.partials_appends[name]
      return if appends.blank?

      appends.inject([]) do |arr, paths|
        Array.wrap(paths).each do |path|
          @context.render(partial: path, locals: locals.merge(json: self))
        end
      end
    end
  end
end

JbuilderTemplate.prepend(Workarea::JbuilderAppendPartials)

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.4.27 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.5.4 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.4.26 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.5.3 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.4.25 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.5.2 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.4.24 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.5.1 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.4.23 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.4.22 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.5.0 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.4.21 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.5.0.beta.1 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.4.20 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.4.19 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.4.18 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.4.17 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.4.16 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.4.15 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb
workarea-core-3.4.14 lib/workarea/ext/jbuilder/jbuilder_append_partials.rb