Octree |
Contact Us |
Our Blog (FR)
Decidim |
Decidim Docs |
Participatory Governance (meta decidim)
Decidim Community (Matrix+Element.io)
Component to create forms in a participatory space, sponsored by the Mkutano Community.
OnlyForms will be available as a Component for a Participatory Space. You can optionally email an organization or space administrator after each submission; see Admin notification email.
- Decidim: >= 0.26, < 0.30
- Ruby: >= 3.2.2
Add this line to your application's Gemfile:
gem "decidim-only_forms"And then execute:
bundle
bundle exec rails decidim_only_forms:install:migrations
bundle exec rails db:migrateThen in the admin panel, add the Forms component (manifest: only_forms) to your participatory space.
These notes are for a space administrator setting up the Forms component.
- Private-only: set
Allow unregisteredto false and use a private participatory space (private users). - Multiple submissions: in step settings, keep
Allow multiple answersas true (default for this component). - Admin export: answers are exportable via the component export
survey_user_answers(CSV/JSON/Excel).
After each successful submission, the component can send one email with the answers (same question and answer rendering as the admin answers view, including textareas, multiple options, and matrix questions). Registered submitters are shown by name; unregistered submitters are labelled as unregistered.
In the component global settings, set Admin notification email to:
- an organization administrator of this organization, or
- a space administrator of this participatory space (admin role on the process or assembly)
Leave the field blank to disable notifications. Any other address is rejected when the component is saved (moderators, evaluators, ordinary participants, and admins of other spaces or organizations are not accepted).
GitLab CI runs bin/ci-setup then unset DATABASE_URL && RAILS_ENV=test bundle exec rspec.
Local CI parity (same images as GitLab: ruby:3.2.2 + PostGIS + Redis):
docker compose -f docker-compose.ci.yml run --rm rspecDev container:
docker compose up -d
docker compose exec -T only_forms bash -lc "cd /home/module && unset DATABASE_URL && bundle install"
docker compose exec -T only_forms bash -lc "cd /home/module && unset DATABASE_URL && bundle exec rake test_app"
docker compose exec -T only_forms bash -lc "cd /home/module && unset DATABASE_URL && RAILS_ENV=test bundle exec rspec"For decidim version 0.27, use Gemfile.0.27. For version 0.26, use Gemfile.0.26
cp Gemfile.0.27 Gemfile
First, you need to run an empty database with a decidim dev container which runs nothing.
docker-compose down -v --remove-orphans
docker-compose up -d
Prefer CI parity:
docker compose -f docker-compose.ci.yml run --rm rspecOr the dev container (unset DATABASE_URL so specs hit decidim_test, not compose DATABASE_URL):
docker compose up -d
docker compose exec -T only_forms bash -lc "cd /home/module && unset DATABASE_URL && bundle install"
docker compose exec -T only_forms bash -lc "cd /home/module && unset DATABASE_URL && bundle exec rake test_app"
docker compose exec -T only_forms bash -lc "cd /home/module && unset DATABASE_URL && RAILS_ENV=test bundle exec rspec"Once created, you access the decidim container
# Get the id of the decidim dev container
docker ps --format {{.ID}} --filter=label=org.label-schema.name=decidim
# 841ae977c7da
docker exec -it 841ae977c7da bash
You are now in bash, run manually. This will check your environment and do migrations if needed
docker-entrypoint
You are now ready to use your container in the way you want for development:
- Run a rails seed:
bundle exec rails db:seed - Have live-reload on your assets:
bin/webpack-dev-server - Execute tasks, like
bundle exec rails g migration AddSomeColumn - Run the rails server:
bundle exec rails s -b 0.0.0.0 - etc.
To stop everything, uses:
docker-compose downto stop the containersdocker-compose down -vto stop the containers and remove all previously saved data.
To debug something on the container:
- Ensure
decidim-appis running
docker ps --all
# CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
# 915e9fc474f2 decidim-module-only_forms-decidim-app "sleep infinity" 7 hours ago Up 7 hours 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp, 0.0.0.0:3035->3035/tcp, :::3035->3035/tcp decidim-only-form-app
# 22304921b7eb postgres:14-alpine "docker-entrypoint.s…" 7 hours ago Up 7 hours (healthy) 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp decidim-module-only_forms-pg-1
- In another terminal, run
docker exec -it 915e9fc474f2 bash - Run
tail -f $ROOT/log/development.logto access logsbundle exec rails restartto restart rails server AND keeps webpacker runningcd $ROOTto access thedevelopment_appcd $ROOT/../decidim_module_only_formsto access the module directory
See Decidim.
This engine is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE


