Skip to content

Latest commit

 

History

History
79 lines (68 loc) · 1.89 KB

README.md

File metadata and controls

79 lines (68 loc) · 1.89 KB

Collect

Collect is a gem for connecting ODK Collect forms to a Rails application.

Installation

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.

Usage

After installation, navigate to: localhost:3000/collect/forms

You can upload xlsform forms in XML format in: localhost:3000/collect/forms/new

Configure ODK Collect

  1. Install the ODK Collect app in your Android device.
  2. Open the ODK Collect app.
  3. Click the menu icon in the top right corner.
  4. Select 'General Settings'.
  5. Select 'Server'.
  6. Adjust the following settings: Type: ODK URL: yourdomain/collect/ Custom server paths Form list path: /formList Submission path: /submission
  7. 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".
  8. Download blank forms.
  9. Fill out forms.
  10. Send forms to server (this will send a form submission to your Rails app).

License

MIT License. Copyright 2022.

Sistematica S. de R.L (www.sistematica.hn)