Sha256: 8a4e7db4324032c62096db7598071b56da0032d594f269e0ee2d0e7dc1dea1e4

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents

ActionController::Routing::Routes.draw do |map|
  root = Surveyor::Config['default.relative_url_root'] || "surveys"
  root = (root << "/").gsub(/\/+/, "/")
  map.with_options :controller => 'surveyor' do |s|
    s.available_surveys "#{root}",                                        :conditions => {:method => :get}, :action => "new"                      # GET survey list
    s.take_survey       "#{root}:survey_code",                            :conditions => {:method => :post}, :action => "create"                  # Only POST of survey to create
    s.view_my_survey    "#{root}:survey_code/:response_set_code.:format", :conditions => {:method => :get}, :action => "show", :format => "html"  # GET viewable/printable? survey
    s.edit_my_survey    "#{root}:survey_code/:response_set_code/take",    :conditions => {:method => :get}, :action => "edit"                     # GET editable survey 
    s.update_my_survey  "#{root}:survey_code/:response_set_code",         :conditions => {:method => :put}, :action => "update"                   # PUT edited survey 
  end   
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
ccls-surveyor-1.0.0 config/routes.rb
jakewendt-surveyor-0.11.3 config/routes.rb
surveyor-0.12.1 config/routes.rb
surveyor-0.11.0 config/routes.rb