Sha256: 53f844095fd32d6c21550339729b9eeb88f673fed5a84fd3f05e7bf8d728aef1

Contents?: true

Size: 1.45 KB

Versions: 12

Compression:

Stored size: 1.45 KB

Contents

== SurveyorController

The SurveyorController class just includes actions from Surveyor::SurveyorControllerMethods module. You may include your own module, and overwrite the methods or add to them using "super". A template for this customization is in your app/controllers/surveyor\_controller.rb. SurveyorController is "unloadable", so changes in development (and any environment that does not cache classes) will be reflected immediately without restarting the app.

== Models

Surveyor's models can all be customized:

- answer
- dependency_condition
- dependency
- question_group
- question
- response_set
- response
- survey_section
- survey
- validation_condition
- validation

For example, create app/models/survey.rb with the following contents:

    class Survey < ActiveRecord::Base
      include Surveyor::Models::SurveyMethods
      def title
        "Custom #{super}"
      end
    end

== SurveyorHelper

The SurveyorHelper module can be customized just like the models:

    module SurveyorHelper
      include Surveyor::Helpers::SurveyorHelperMethods
      def rc_to_as(type_sym)
        case type_sym.to_s
        when /(integer|float)/ then :string
        when /(datetime)/ then :string
        when /^date$/ then :string
        else type_sym
        end
      end
    end

== Views

Surveyor's views can be overwritten by simply creating views in app/views/surveyor

== Layout

Create a custom SurveyorController as above, and specify your custom layout in it.

Version data entries

12 entries across 12 versions & 4 rubygems

Version Path
upgrade_surveyor-1.4.2 lib/generators/surveyor/templates/surveys/EXTENDING_SURVEYOR.md
affectiva-surveyor-1.5.0.pre.disco.2 lib/generators/surveyor/templates/surveys/EXTENDING_SURVEYOR.md
hssc_surveyor-1.4.3.pre lib/generators/surveyor/templates/surveys/EXTENDING_SURVEYOR.md
hssc_surveyor-1.4.2.pre lib/generators/surveyor/templates/surveys/EXTENDING_SURVEYOR.md
hssc_surveyor-1.4.1.pre lib/generators/surveyor/templates/surveys/EXTENDING_SURVEYOR.md
surveyor-1.4.0 lib/generators/surveyor/templates/surveys/EXTENDING_SURVEYOR.md
surveyor-1.3.0 lib/generators/surveyor/templates/surveys/EXTENDING_SURVEYOR.md
surveyor-1.2.0 lib/generators/surveyor/templates/surveys/EXTENDING_SURVEYOR.md
surveyor-1.1.0 lib/generators/surveyor/templates/surveys/EXTENDING_SURVEYOR.md
surveyor-1.0.1 lib/generators/surveyor/templates/surveys/EXTENDING_SURVEYOR.md
surveyor-1.0.0 lib/generators/surveyor/templates/surveys/EXTENDING_SURVEYOR.md
surveyor-0.22.0 lib/generators/surveyor/templates/surveys/EXTENDING_SURVEYOR.md