Module SmerfFormsHelper
In: app/helpers/smerf_forms_helper.rb

This module contains all the helper methods used by the smerf form views.

Methods

Included Modules

SmerfSystemHelpers

Public Instance methods

This method creates a formatted error message that is then displayed on the smerf form page to inform the user of any errors.

CSS identifier: smerfFormError

This method creates a formatted notice message that is then displayed on the smerf form. The notice message is retrieved from the flash[:notice].

CSS identifier: smerfFormNotice

This method retrieves all the questions defined for the group passed in as a parameter.

This method retrieves all the groups defined in the form.

This method retrieves and formats the group description of the group passed in as a parameter.

CSS identifier: smerfGroup

This method retrieves and formats the group name of the group passed in as a parameter.

CSS identifier: smerfGroup

This method formats the question, and any answers and subquestions defined for it. The method takes a question object(SmerfQuestion) and a level indicator as parameters. The level indicator tells us if a question is a subquestion or not (level > 1).

The question type is checked to see how is should be formatted, currently the following formats are supported:

  • Multiple choice (checkbox)
  • Single choice (radio)
  • Text field (large amount of text)
  • Text box (small amount of text)

CSS identifiers:

  smerfQuestionHeader
  smerfQuestion
  smerfSubquestion
  smerfQuestionError
  smerfInstruction

This method retrieves and formats the form thank you message.

CSS identifier: smerfThankyou

This method retrieves and formats the form title.

CSS identifier: h2

This method retrieves and formats the form welcome message.

CSS identifier: formWelcome

[Validate]