1
0
Fork 0

modified docs according to new field model structure

Dieser Commit ist enthalten in:
Faizaan Gagan 2021-06-01 10:57:49 +05:30
Ursprung f9f67c09e8
Commit 28094ab17b
4 geänderte Dateien mit 16 neuen und 15 gelöschten Zeilen

Datei anzeigen

@ -20,7 +20,7 @@ export default {
/*
* unit: custom_wizard:templates_and_builder
* type: step
* number: 9
* number: 8
* title: Handle the attribute in the wizard client
* description: We can now handle our new attribute in the wizard client.
* For our "highlighted" attribute, we would add a

Datei anzeigen

@ -66,14 +66,6 @@ class CustomWizard::AdminWizardController < CustomWizard::AdminController
]
end
##
# type: step
# number: 3
# title: Add a permitted parameter
# description: The custom wizard server admin controller will only accept
# permitted attributes...
##
def save_wizard_params
params.require(:wizard).permit(
:id,

Datei anzeigen

@ -3,6 +3,21 @@
class CustomWizard::Field
include ActiveModel::SerializerSupport
##
# type: step
# number: 3
# title: Add the field name to attribute map
# description: The attribute map serves as a global registry for field attributes. Set the
# key as the attribute name and value as an array of properties. Use the properties according to the
# your usecase. Here's a list and description of each of the properties.
# accessible: The attribute is passed to attr_accessor
# serializable: The attribute is serialized to the client
# permitted: The attribute is permitted to be passed to the admin side controller for saving
# mapped: The attribute is a mapped attributed and is permitted to be passed to the admin side controller for saving
# excluded: The attribute is not initialized in the constructor. This is used
# if the attribute needs a method
##
def self.attribute_map
{
raw: [],

Datei anzeigen

@ -1,11 +1,5 @@
# frozen_string_literal: true
##
# type: step
# number: 8
# title: Add it to the serializer
# description: We want our new attribute to be serialized to the wizard client...
##
class CustomWizard::FieldSerializer < ::ApplicationSerializer
attributes *CustomWizard::Field.serializable_attributes