-
Notifications
You must be signed in to change notification settings - Fork 17
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
Advanced_view does not work with JSON arrays #5
Comments
Hey @sedubois nice catch, thanks. What do you think will be the most comfortable way to use an array feature? Something like this: Field::JSONB.with_options(array: true) or Field::JSONB.with_options(advanced_view: []) Share your opinion, please |
@volkov-sergey at first thought I would use another name than "advanced view", technically what is being described here is a description of the JSON's schema. E.g for both arrays and objects: # JSON array
Field::JSONB.with_options(schema: Field::JSONB::Array(
Field::String
))
# JSON object
Field::JSONB.with_options(schema: Field::JSONB::Hash(
'name' => Field::String,
...
)) Or something like that. Then there is the (separate) question of how to render the form and data, either with jsoneditor or custom. To start, could just use custom views when |
@sedubois working on it |
How is it going for this feature? |
Currently it is not possible to use the
advanced_view
option for displaying JSON arrays as the code is defined as follows:E.g if the JSON value is
["one", "two", "three"]
, it would be nice to be able to just displayone, two, three
instead of the heavy-looking jsoneditor, and also thisadvanced_view
is necessary to enforce the structure of the data (e.g ensuring the editor won't enter a hash when an array should be provided).The text was updated successfully, but these errors were encountered: