Class: Decidim::Pages::DataSerializer
- Inherits:
-
Exporters::Serializer
- Object
- Exporters::Serializer
- Decidim::Pages::DataSerializer
- Includes:
- TranslationsHelper
- Defined in:
- app/serializers/decidim/pages/data_serializer.rb
Overview
This class serializes the specific data in each Page. This is the page data outside of the component settings.
Instance Method Summary collapse
-
#serialize ⇒ Hash
Serializes the page data for this component.
Instance Method Details
#serialize ⇒ Hash
Serializes the page data for this component.
13 14 15 16 17 18 19 |
# File 'app/serializers/decidim/pages/data_serializer.rb', line 13 def serialize page = Page.find_by(component: resource) { body: page&.body || empty_translatable } end |