Compétences : Ruby on Rails, AJAX, Ruby Gems, Active Records, SCSS
La gem activeadmin-magicfields est un projet voué à apporter un système simple de sections dynamiques et de champs personalisables au système de gestion de contenu Active Admin. C'est une expérience qui essaie de recréer quelques-unes des fonctions du fameux plugin Advanced Custom Fields pour Wordpress, qui lui-même permet aux utilisateurs de gérer des contenus complexes sur leur site sans aucune notion préalable de code.
I started this project as a challenge to myself, considering that I had been working a lot withWordpress and the Advanced Custom Fields plugin, which I liked for its relative simplicity of use for clients while in fact using quite complex process under the hood.
I was also using Active Admin on a Ruby on Rails project, which led me to try and see if I could bring a similar behavior in a gem. It required significant data structure planning before starting to develop, because of the high level of abstraction inherent to the concept.
Once the planning phase was done, the implementation in a ruby gem turned also to be more complex than foreseen, because of the dynamic nature of the data structures in play.
I carried this project on my own as an experiment with Ruby, Rails and the process of making gems. I learnt a lot about gem structuring and Ruby on Rails in itself, since this project was covering many parts of a typical web application, dynamic form building and validating being the core of the challenge.
This was a very short project made the quick'n'dirty way, which explains why so many improvements are still in plan.
As displayed on the above screenshot, the gem first enables user to define "parts", which are basically section templates. The gem provides most basic field types out of the box - like text, image and checkboxes, as well as an easy way (even if requiring minimal coding) to add more types.
From there, the user can add as many parts they need on their models with a click of a button. The gem dynamically creates the appropriate fields in the model's form, and the only thing left to do is to feel in the content!
Below, a new page is created, with a landing section, a simple text section, and more sections being added.