#surveyor
  - unless (types = flash.keys.select{|k| [:notice, :error, :warning].include?(k)}).blank?
    .surveyor_flash
      = flash_messages(types)
      .close
  = semantic_form_for(@response_set, :as => :r, :url => surveyor.update_my_survey_path(current_section: @section.id), :html => {:method => :put, :id => "survey_form", :class => @survey.custom_class}) do |f|

    = hidden_field_tag :surveyor_javascript_enabled, false

    = render 'partials/section_menu' # unless @sections.size < 3
    .survey_title= @survey.translation(I18n.locale)[:title]
    .previous_section= previous_section
    = render 'partials/dependents' unless @dependents.empty?
    - if false #@response_set.no_responses_for_section?(@section) # cache if response_set has no responses for current section
      = cache("section_#{@section.id}"){ render "/partials/section", :f => f }
    - else # no cache
      = render "/partials/section", :f => f
    .next_section= next_section
  %br

:javascript
  $(document).ready(function() {
    $("input#surveyor_javascript_enabled").val(true);
  });
#surveyor
  - unless (types = flash.keys.select{|k| %w(notice, error, warning).include?(k)}).blank?
    .surveyor_flash
      = flash_messages(types)
      .close
  = semantic_form_for(@response_set, :as => :r, :url => surveyor.update_my_survey_path(current_section: @section.id), :html => {:method => :put, :id => "survey_form", :class => @survey.custom_class}) do |f|

    = hidden_field_tag :surveyor_javascript_enabled, false

    = render 'partials/section_menu' # unless @sections.size < 3
    .survey_title= @survey.translation(I18n.locale)[:title]
    .previous_section= previous_section
    = render 'partials/dependents' unless @dependents.empty?
    - if false #@response_set.no_responses_for_section?(@section) # cache if response_set has no responses for current section
      = cache("section_#{@section.id}"){ render "/partials/section", :f => f }
    - else # no cache
      = render "/partials/section", :f => f
    .next_section= next_section
  %br

:javascript
  $(document).ready(function() {
    $("input#surveyor_javascript_enabled").val(true);
  });
Update how flash messages are handled for Rails 4.1
Update how flash messages are handled for Rails 4.1
