Attributes_table formatting using Arbre in ActiveAdmin

1.2k Views Asked by At

I am displaying an ActiveAdmin registered model to the user.

ActiveAdmin.register ConfigurationFile do
  show do
    attributes_table do
      row :name
      row :filename
      row :content
    end
  end
end

:content is a string with newlines, but when rendered by Arbre newlines and extra whitespace are dropped.

How can I display :content without dropping extra whitespace and newlines?

1

There are 1 best solutions below

2
On BEST ANSWER

Take a look at html_safe:

 show do |configuration_file|
   attributes_table do
     # other rows
     row 'Content' do
       configuration_file.content.html_safe
     end
   end
 end