Collect is a gem for connecting ODK Collect forms to a Rails application.
Add this line to your application's Gemfile:
gem 'collect', github: 'SistematicaHN/collect', branch: 'main'
Run bundle install.
$ bundle install
Run the generator to add the default configuration.
$ rails g collect:install
Migrate the database.
$ rails db:migrate
Collect requires Active Storage to be installed. So if you don't have Active Storage installed run:
$ rails active_storage:install
$ rails db:migrate
You will need an environment variable defined as "DOMAIN".
DOMAIN
is the domain your app uses.
For example:
DOMAIN: "https://96fdf8f744b6g.ngrok.io"
Add the 'crack' and 'responders', gem to your app's gemfile.
gem 'crack'
gem 'responders'
Run bundle install:
$ bundle install
Then, install responders.
$ rails g responders:install
You should be all set to go at this point.
After installation, navigate to: localhost:3000/collect/forms
You can upload xlsform forms in XML format in: localhost:3000/collect/forms/new
- Install the ODK Collect app in your Android device.
- Open the ODK Collect app.
- Click the menu icon in the top right corner.
- Select 'General Settings'.
- Select 'Server'.
- Adjust the following settings: Type: ODK URL: yourdomain/collect/ Custom server paths Form list path: /formList Submission path: /submission
- If you have added forms like in the "Usage" section above, then go back to the ODK Collect main menu and select "Get Blank Form".
- Download blank forms.
- Fill out forms.
- Send forms to server (this will send a form submission to your Rails app).
MIT License. Copyright 2022.