Rhubarb

Rhubarb is a Ruby on Rails application we're working on that is designed to be a data capture tool for the web. Below is a short explanation about how things work.

Application Layout

Here's a diagram:

rhubarb-diagram.png

Projects have users and forms. Each user has a role of manager, data entry, read-only, or guest. Each role has a set of permissions that define what that role can do. Each form has questions and/or sections, the latter having questions and other sections.

The data for each project is stored in a separate database to avoid name conflicts. One of our major desires for Rhubarb is to separate the data and the application as much as possible. This is advantageous for many reasons, one being that data is still accessible if the application goes down.

YAML Specification

Rhubarb uses YAML as its main format to import project information. See RhubarbYAML for more information.

Exporting Features

Rhubarb has the capability to export its data to a compressed R data file. Exporting data to an R data file will create different R objects depending on the structures of a project's forms. Forms with no sections are converted into data frames, whereas forms with sections are converted into lists of data frames and other lists if those included sections also have sections, etc. Questions that can have multiple values of a categorical variable are stored as delimited strings with a class of 'mChoice' and a 'levels' attribute, which is a character vector of all the possible answers. Questions that require one categorical answer are stored as factors. A sample data set is attached below. Example results of running load( ); html(contents()) in R on an exported dataset are also below. Users with appropriate access privileges can access the source dataset at https://biostat3.mc.vanderbilt.edu/rhubarb.

Current Status

Rhubarb is currently being rewritten to be much more robust and to fit the latest Rails specifications. Development is proceeding by using the RSpec library with a technique called Test Driven Development, which ensures that as much code as possible is thoroughly tested. It's a slow process, but the result will be well worth it.

Trac

Rhubarb's trac can be found at: https://biostat.mc.vanderbilt.edu/trac/rhubarb. Please contact Jeremy Stephens if you'd like permission to browse the source.

Other Notes

The Ubuntu (Fiesty) version of the sqlite3 gem for Ruby is outdated and doesn't work with Rhubarb. Install it directly with rubygems with the following commands:
sudo apt-get install ruby1.8-dev libsqlite3-dev
sudo gem install -y sqlite3-ruby

Subversion Log

Note: In the interest of keeping this page from getting monstrously long, only the last 10 logs are shown.

r100 [2008-05-09 14:13:34 -0500 (Fri, 09 May 2008)] by JeremyStephens

Log
Generated subjects/forms controller

- moved before_filter to the application controller

Files
  • A branches/organic/app/controllers/subjects/
  • A branches/organic/app/controllers/subjects/forms_controller.rb
  • A branches/organic/app/helpers/subjects/
  • A branches/organic/app/helpers/subjects/forms_helper.rb
  • A branches/organic/app/views/subjects/forms/
  • A branches/organic/app/views/subjects/forms/edit.rhtml
  • A branches/organic/app/views/subjects/forms/index.rhtml
  • A branches/organic/app/views/subjects/forms/new.rhtml
  • A branches/organic/app/views/subjects/forms/show.rhtml
  • A branches/organic/spec/controllers/subjects/
  • A branches/organic/spec/controllers/subjects/forms_controller_spec.rb
  • A branches/organic/spec/helpers/subjects/
  • A branches/organic/spec/helpers/subjects/forms_helper_spec.rb
  • A branches/organic/spec/views/subjects/forms/
  • A branches/organic/spec/views/subjects/forms/edit.rhtml_spec.rb
  • A branches/organic/spec/views/subjects/forms/index.rhtml_spec.rb
  • A branches/organic/spec/views/subjects/forms/new.rhtml_spec.rb
  • A branches/organic/spec/views/subjects/forms/show.rhtml_spec.rb
  • M branches/organic/app/controllers/application.rb
  • M branches/organic/app/controllers/main_controller.rb
  • M branches/organic/app/controllers/projects_controller.rb
  • M branches/organic/app/controllers/sessions_controller.rb
  • M branches/organic/app/controllers/specification_controller.rb
  • M branches/organic/spec/controllers/contents_controller_spec.rb
  • M branches/organic/spec/controllers/definitions_controller_spec.rb
  • M branches/organic/spec/controllers/forms_controller_spec.rb
  • M branches/organic/spec/controllers/questions_controller_spec.rb
  • M branches/organic/spec/controllers/subjects_controller_spec.rb
  • M branches/organic/spec/controllers/views_controller_spec.rb

r99 [2008-04-21 16:44:46 -0500 (Mon, 21 Apr 2008)] by JeremyStephens

Log
  • Reworked the subject form helper; abandoned testing on that, since it was getting on my nerves
  • Fixed subject editing/updating

Files
  • A branches/organic/spec/libs/echo_form_builder_spec.rb
  • M branches/organic/app/controllers/subjects_controller.rb
  • M branches/organic/app/helpers/application_helper.rb
  • M branches/organic/app/helpers/subjects_helper.rb
  • M branches/organic/app/views/subjects/edit.rhtml
  • M branches/organic/app/views/subjects/new.rhtml
  • M branches/organic/app/views/subjects/show.rhtml
  • M branches/organic/spec/controllers/subjects_controller_spec.rb
  • M branches/organic/spec/helpers/application_helper_spec.rb
  • M branches/organic/spec/views/subjects/edit.rhtml_spec.rb
  • M branches/organic/spec/views/subjects/new.rhtml_spec.rb
  • M branches/organic/spec/views/subjects/show.rhtml_spec.rb
  • D branches/organic/spec/views/render_generated_view_spec.rb

r98 [2008-04-21 14:58:57 -0500 (Mon, 21 Apr 2008)] by JeremyStephens

Log
Way overdue commit. Finally had some time to get some work done on this.

Details:
  • Updated render_generated_view to accept more options
  • Added more validations on Form#name
  • Project now creates a Subject class on creation, along with a Subject table
  • Project no longer tries to delete its database when it's destroyed, since that doesn't work smile
  • Changed Definition#to_select_options to always use strings for values
  • Added subjects' show view
  • Bit o' sprucing up views here and there
  • Added a rake task to help with testing

Files
  • A branches/organic/lib/tasks/rhubarb.rake
  • A branches/organic/themes/professional/images/delete.gif
  • A branches/organic/themes/professional/images/edit.gif
  • A branches/organic/themes/professional/images/show.gif
  • A branches/organic/themes/professional/stylesheets/subjects.css
  • M branches/organic/app/controllers/projects_controller.rb
  • M branches/organic/app/controllers/subjects_controller.rb
  • M branches/organic/app/helpers/application_helper.rb
  • M branches/organic/app/models/definition.rb
  • M branches/organic/app/models/form.rb
  • M branches/organic/app/models/project.rb
  • M branches/organic/app/views/main/welcome.rhtml
  • M branches/organic/app/views/projects/index.rhtml
  • M branches/organic/app/views/projects/new.rhtml
  • M branches/organic/app/views/specification/new.rhtml
  • M branches/organic/app/views/subjects/new.rhtml
  • M branches/organic/app/views/subjects/show.rhtml
  • M branches/organic/config/environment.rb
  • M branches/organic/config/routes.rb
  • M branches/organic/lib/container_extensions.rb
  • M branches/organic/lib/view_generator.rb
  • M branches/organic/spec/controllers/projects_controller_spec.rb
  • M branches/organic/spec/controllers/subjects_controller_spec.rb
  • M branches/organic/spec/fixtures/schematics.yml
  • M branches/organic/spec/fixtures/views.yml
  • M branches/organic/spec/helpers/application_helper_spec.rb
  • M branches/organic/spec/libs/view_generator_spec.rb
  • M branches/organic/spec/models/definition_spec.rb
  • M branches/organic/spec/models/form_spec.rb
  • M branches/organic/spec/models/project_spec.rb
  • M branches/organic/spec/spec_helper.rb
  • M branches/organic/spec/views/layouts/application_view_spec.rb
  • M branches/organic/spec/views/subjects/new.rhtml_spec.rb
  • M branches/organic/spec/views/subjects/show.rhtml_spec.rb
  • M branches/organic/stories/all.rb
  • M branches/organic/stories/helper.rb
  • M branches/organic/themes/professional/layouts/application.rhtml
  • M branches/organic/themes/professional/stylesheets/rhubarb.css
  • D branches/organic/previous_failures.txt

r97 [2008-01-15 17:53:39 -0600 (Tue, 15 Jan 2008)] by JeremyStephens

Log
More work on rendering Form's. You can actually create a subject through the GUI now!
  • added render_generated_view to the application helper
  • added some assigns to the subjects controller for the generated view
  • added a name field to View and fixed the (created|updated)_by field type
  • updated the building story to check for View's
  • ViewGenerator changes
    • removed form_for from the template because bad things would have happened during template nesting
    • added scoping for sub-sections!
  • Rhubarb::Builder now generates views
  • added ScopedFormBuilder class to make it easier to build forms for models that have relationships

Stuff to do next:
  • handle subforms in the subjects controller via glob routing
  • write methods to handle saving scoped data in the controller
  • dance

Files
  • A branches/organic/lib/scoped_form_builder.rb
  • A branches/organic/spec/resources/views/render_generated_view_example.rhtml
  • A branches/organic/spec/resources/views/scoped_form_builder_example.rhtml
  • A branches/organic/spec/views/render_generated_view_spec.rb
  • A branches/organic/spec/views/scoped_form_builder_spec.rb
  • M branches/organic/app/controllers/subjects_controller.rb
  • M branches/organic/app/helpers/application_helper.rb
  • M branches/organic/app/views/subjects/new.rhtml
  • M branches/organic/db/migrate/021_create_views.rb
  • M branches/organic/lib/rhubarb/builder.rb
  • M branches/organic/lib/view_generator.rb
  • M branches/organic/spec/controllers/subjects_controller_spec.rb
  • M branches/organic/spec/helpers/application_helper_spec.rb
  • M branches/organic/spec/libs/rhubarb/builder_spec.rb
  • M branches/organic/spec/libs/view_generator_spec.rb
  • M branches/organic/spec/views/subjects/edit.rhtml_spec.rb
  • M branches/organic/spec/views/subjects/new.rhtml_spec.rb
  • M branches/organic/spec/views/subjects/show.rhtml_spec.rb
  • M branches/organic/stories/building/building.story
  • M branches/organic/stories/building/steps.rb
  • M branches/organic/themes/professional/stylesheets/rhubarb.css
  • D branches/organic/spec/resources/views/subject_form_for_example.rhtml

r96 [2008-01-07 17:55:04 -0600 (Mon, 07 Jan 2008)] by JeremyStephens

Log
Form rendering-related stuff:
  • removed SubjectsHelper#subject_form_for
  • added Definition#to_select_options
  • created the ViewGenerator module with methods to generate a View from a Form or Section
  • removed Rhubarb::FormBuilder

Next up is making Rhubarb::Builder call Form#generate_view for each Form.

Files
  • A branches/organic/lib/view_generator.rb
  • A branches/organic/spec/libs/view_generator_spec.rb
  • M branches/organic/app/helpers/subjects_helper.rb
  • M branches/organic/app/models/definition.rb
  • M branches/organic/app/models/form.rb
  • M branches/organic/app/models/section.rb
  • M branches/organic/app/views/subjects/new.rhtml
  • M branches/organic/spec/helpers/subjects_helper_spec.rb
  • M branches/organic/spec/libs/rhubarb/builder_spec.rb
  • M branches/organic/spec/models/definition_spec.rb
  • M branches/organic/spec/models/form_spec.rb
  • M branches/organic/spec/models/section_spec.rb
  • M branches/organic/spec/views/subjects/new.rhtml_spec.rb
  • D branches/organic/lib/rhubarb/form_builder.rb
  • D branches/organic/spec/libs/rhubarb/form_builder_spec.rb

r95 [2008-01-04 17:01:53 -0600 (Fri, 04 Jan 2008)] by JeremyStephens

Log
  • Messed around with SubjectsHelper#subject_form_for and Rhubarb::FormBuilder, which will probably be abandoned in favor of pre-generated views
  • Generated the scaffold for View, which will probably end up causing problems
  • Connected View to Form and Section through relationships

The actual HTML rendering of a Form only needs to happen whenever its contents are changed. I'm already storing Schematics in the database, so why not Views? It should make for an interesting time anyway.

Files
  • A branches/organic/app/controllers/views_controller.rb
  • A branches/organic/app/helpers/views_helper.rb
  • A branches/organic/app/models/view.rb
  • A branches/organic/app/views/views/
  • A branches/organic/app/views/views/edit.rhtml
  • A branches/organic/app/views/views/index.rhtml
  • A branches/organic/app/views/views/new.rhtml
  • A branches/organic/app/views/views/show.rhtml
  • A branches/organic/db/migrate/021_create_views.rb
  • A branches/organic/spec/controllers/views_controller_spec.rb
  • A branches/organic/spec/controllers/views_routing_spec.rb
  • A branches/organic/spec/fixtures/views.yml
  • A branches/organic/spec/helpers/views_helper_spec.rb
  • A branches/organic/spec/models/view_spec.rb
  • A branches/organic/spec/resources/
  • A branches/organic/spec/resources/views/
  • A branches/organic/spec/resources/views/subject_form_for_example.rhtml
  • A branches/organic/spec/views/views/
  • A branches/organic/spec/views/views/edit.rhtml_spec.rb
  • A branches/organic/spec/views/views/index.rhtml_spec.rb
  • A branches/organic/spec/views/views/new.rhtml_spec.rb
  • A branches/organic/spec/views/views/show.rhtml_spec.rb
  • M branches/organic/app/controllers/subjects_controller.rb
  • M branches/organic/app/helpers/subjects_helper.rb
  • M branches/organic/app/models/form.rb
  • M branches/organic/app/models/section.rb
  • M branches/organic/app/views/subjects/new.rhtml
  • M branches/organic/config/routes.rb
  • M branches/organic/spec/controllers/subjects_controller_spec.rb
  • M branches/organic/spec/helpers/subjects_helper_spec.rb
  • M branches/organic/spec/libs/rhubarb/form_builder_spec.rb
  • M branches/organic/spec/models/form_spec.rb
  • M branches/organic/spec/models/section_spec.rb
  • M branches/organic/spec/views/subjects/new.rhtml_spec.rb

r94 [2007-12-20 14:45:13 -0600 (Thu, 20 Dec 2007)] by JeremyStephens

Log
  • Added the derived_from class method for the generated classes so I can get back to the Form/Section they're derived from
  • Added the beginnings of the Rhubarb::FormBuilder class
  • Various theme-related changes

Files
  • A branches/organic/lib/rhubarb/form_builder.rb
  • A branches/organic/spec/libs/rhubarb/form_builder_spec.rb
  • M branches/organic/app/models/form.rb
  • M branches/organic/app/models/section.rb
  • M branches/organic/app/views/projects/show.rhtml
  • M branches/organic/app/views/subjects/index.rhtml
  • M branches/organic/spec/fixtures/files/remembrall.yml
  • M branches/organic/spec/models/form_spec.rb
  • M branches/organic/spec/views/layouts/application_view_spec.rb
  • M branches/organic/spec/views/projects/show_view_spec.rb
  • M branches/organic/spec/views/specification/new_view_spec.rb
  • M branches/organic/spec/views/subjects/index.rhtml_spec.rb
  • M branches/organic/themes/professional/layouts/application.rhtml
  • M branches/organic/themes/professional/stylesheets/rhubarb.css

r93 [2007-12-20 13:14:26 -0600 (Thu, 20 Dec 2007)] by JeremyStephens

Log
Added theme images; made a few changes to professional theme.

Files
  • A branches/organic/public/images
  • A branches/organic/themes/curvy/images/
  • A branches/organic/themes/curvy/images/bfill.gif
  • A branches/organic/themes/curvy/images/bl.gif
  • A branches/organic/themes/curvy/images/br.gif
  • A branches/organic/themes/curvy/images/rfill.gif
  • A branches/organic/themes/curvy/images/spinner.gif
  • A branches/organic/themes/curvy/images/tfill.gif
  • A branches/organic/themes/curvy/images/tl.gif
  • A branches/organic/themes/curvy/images/tr.gif
  • A branches/organic/themes/professional/images/
  • A branches/organic/themes/professional/images/banner.png
  • A branches/organic/themes/professional/images/spinner.gif
  • M branches/organic/themes/professional/layouts/application.rhtml
  • M branches/organic/themes/professional/stylesheets/rhubarb.css

r92 [2007-12-20 13:13:04 -0600 (Thu, 20 Dec 2007)] by JeremyStephens

Log
Removing images so I can link it back to a theme.

Files
  • A branches/organic/public/stylesheets
  • D branches/organic/public/images/

r91 [2007-12-20 11:28:14 -0600 (Thu, 20 Dec 2007)] by JeremyStephens

Log
One more commit for theme support.

Files
  • A branches/organic/app/views/layouts
  • D branches/organic/public/stylesheets/
Topic attachments
I AttachmentSorted ascending Action Size Date Who Comment
DeanSurvey.htmlhtml DeanSurvey.html manage 35.5 K 26 Jul 2007 - 16:06 FrankHarrell R html(contents()) from Deans Survey
remembrall-export.rdarda remembrall-export.rda manage 39.5 K 02 Feb 2007 - 14:44 JeremyStephens sample data set (R version 2.4.0 Patched (2006-11-25 r39997))
rhubarb-diagram.pngpng rhubarb-diagram.png manage 6.8 K 08 Jan 2007 - 14:41 JeremyStephens diagram
rhubarb-layout.jpgjpg rhubarb-layout.jpg manage 166.1 K 29 Jun 2007 - 10:05 JeremyStephens rhubarb mock layout
Topic revision: r259 - 09 May 2008, SubversionUser
 

This site is powered by FoswikiCopyright © 2013-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Vanderbilt Biostatistics Wiki? Send feedback