eddietejeda / administrate-field-json Goto Github PK
View Code? Open in Web Editor NEWA plugin to show and edit JSON objects within Administrate.
License: MIT License
A plugin to show and edit JSON objects within Administrate.
License: MIT License
Thanks very much for making a json field, exactly what I'm looking for.
On install (Rails 4.2.0, Administrate 0.2.2) the javascript doesn't load for me. I notice that administrate-field-json.js
is in an administrate-field-json subdirectory of assets, i.e. /app/assets/javascripts/administrate-field-json/administrate-field-json.js
So I have to change:
Administrate::Engine.add_javascript "administrate-field-json"
to
Administrate::Engine.add_javascript "administrate-field-json/administrate-field-json"
in /lib/administrate/field/json.rb in order to load the javascript.
Is there a reason for the subdirectory, or a different approach you prefer? Removing the subdirectory also fixes the issue for me. Happy to submit a PR with either.
Do you intend to release this under an open source license? Very interested in using and contributing.
how do I get this to work in the show view? I was able to get it to render correctly, but the it is not disabled
<div class="field-unit__field administrate-jsoneditor">
<%= text_area field.attribute, nil, value: JSON.pretty_generate(field.data), disabled: true %>
</div>
I notice this project gets a bit of traffic. I don't have time to manage this anymore and this tool is no longer related to my work.
Anyone interested in taking over this project?
Hello, @eddietejeda! Thanks for your work, mate! Your gem inspired me to create an updated version of JSON editing field for administrate.
https://github.com/codica2/administrate-field-jsonb
Maybe it can help someone.
Features:
this gem +
Any plans to release this with Rails 5 support?
Thanks for producing this gem, I'm having some trouble regarding Administrate treating my JSON attributes as String.
I am unable to use this gem with the latest version of Administrate, however:
Bundler could not find compatible versions for gem "administrate":
In snapshot (Gemfile.lock):
administrate (= 0.3.0)
In Gemfile:
administrate (~> 0.3.0)
administrate-field-json was resolved to 0.0.2, which depends on
administrate (~> 0.2.2)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Administrate 0.3 is required to support Rails 5, which I am using.
Any plans to update to the latest version of Administrate? Thanks!
First of all: thanks for making this! We had a need for the same in administrate, so a github search turned up your gem, however would you be able to push this to rubygems.org? Thanks for considering!
Are they working for anyone else? The scripts
in package.json move jsoneditor-icons.svg to vendor/assets/images, and then sed -i.bak 's/img/\\/assets/g'
. Since Sprockets notoriously doesn't generate non-digested assets in Rails 4, this simple path substitution doesn't work because a fingerprint gets added to the jsoneditor-icons.svg filename.
Am I missing something, or other ideas? If not I'll submit a fix. My first thought is to move the .svg file to /public instead of /vendor/assets/images.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.