Skip to content

Field output as HTML? #49

Description

@pboling

In my model:

  def array_of_stuff
    [
      1,
      2,
      3
    ]
  end

In my config:

        - field: array_of_stuff
          header: cool things
          method: multiline

In my helper utils class:

class MyHelperUtils < TinyAdmin::Support
  def multiline(array, options: [])
    array.join("<br/>") # Doesn't matter if I append `.html_safe`, or anything else I've tried
  end
end

Page Result in the browser (<br/> tags appear as raw text, not as HTML):

1<br/>2<br/>3

The above is wrapped in actual HTML <span> open/close tags.

Is there a way to have a helper output HTML and have it render as HTML?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions