Sha256: 4201a000f48bf2935892d1c3dcf434b9ac3dcc68ba989fdad04ad4b2236d630d

Contents?: true

Size: 478 Bytes

Versions: 28

Compression:

Stored size: 478 Bytes

Contents

# frozen_string_literal: true

module PagesCore
  module Admin
    module TagEditorHelper
      def tag_editor_for(form, object, attribute: :serialized_tags)
        object ||= form.object
        react_component(
          "TagEditor",
          { enabled: object.tags.map(&:name),
            tags: Tag.tags_and_suggestions_for(object, limit: 20)
                     .map(&:name),
            name: "#{form.object_name}[#{attribute}]" }
        )
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
pages_core-3.15.5 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.15.4 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.15.3 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.15.2 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.15.1 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.14.0 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.13.0 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.12.7 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.12.6 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.12.5 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.12.4 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.12.3 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.12.2 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.12.1 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.12.0 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.11.3 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.11.2 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.11.1 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.11.0 app/helpers/pages_core/admin/tag_editor_helper.rb
pages_core-3.10.2 app/helpers/pages_core/admin/tag_editor_helper.rb