Comments (4)
@sedubois working on it
from administrate-field-jsonb.
How is it going for this feature?
from administrate-field-jsonb.
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
from administrate-field-jsonb.
@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 schema
is provided (like now). Then as a second step there could be a way to control this too (either by passing a render
option, or by letting user override views).
from administrate-field-jsonb.
Related Issues (16)
- save field results in to_s version all the time HOT 22
- Generator does not set field as Field::JSONB
- JSON editor icons are invisible in production HOT 2
- Advanced View, but with user-defined keys HOT 1
- Advanced View List Header Labels HOT 1
- Duplicated JSONEditor elements with Turbolinks HOT 1
- bumping momentjs-rails to 2.29.1 breaks rendering
- Rails 7 compatibility HOT 1
- Validations with JsonEditor
- advanced_view with Field::Select
- Empty array shows `null` not `[]`
- Storing as Hash doesn't work in Rails 6.1.4 with the README documentation
- Displays 2 empty lines when JSON is empty object HOT 2
- JSON editor is not present when creating nested resources HOT 2
- Displays/assigns null when showing/editing empty object
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from administrate-field-jsonb.