class Decidim::Pages::DataSerializer

data outside of the component settings.
This class serializes the specific data in each Page. This is the page

def serialize

Returns:
  • (Hash) - The serialized data
def serialize
  page = Page.find_by(component: resource)
  {
    body: page&.body || empty_translatable
  }
end