class SectionTwoController < ApplicationController
  before_action :authenticate_applicant!
  before_action :populate_section

  def index

  end

  def update
    @section = SectionTwo.find(params[:id])
    @section.update_attributes(section_params)
    redirect_to section_threes_path
  end

  private
    def populate_section
      application = current_applicant.application
      @section = application.section_two unless application.nil?
      @section ||= SectionTwo.new
    end

    def section_params
      params.require(:section_two).permit(:organization_history_summary,
        :organization_vision, :projects_description, :project_geography,
        :application_id)
    end
end
