Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field output as HTML? #49

Open
pboling opened this issue Jun 19, 2024 · 0 comments
Open

Field output as HTML? #49

pboling opened this issue Jun 19, 2024 · 0 comments

Comments

@pboling
Copy link

pboling commented Jun 19, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant