Sha256: 2ebc5755cb87b63081e1582790e37b7bf79a236032210fd1e1d7e454d26d9800

Contents?: true

Size: 694 Bytes

Versions: 19

Compression:

Stored size: 694 Bytes

Contents

module Adminpanel
  class SectionsController < Adminpanel::ApplicationController
    def index
      @sections = Section.all
    end

    def edit
      @section = Section.find(params[:id])
    end

    def update
      @section = Section.find(params[:id])

      if @section.update(section_params)
        redirect_to section_path(@section), notice: 'La seccion se ha actualizado'
      else
        render 'edit'
      end
    end

    private
    def section_params
      params.require(:section).permit(
        :has_description,
        :description,
        :key,
        :page,
        :name,
        :max_files,
        :has_image,
        sectionfile_ids: []
      )
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
adminpanel-3.6.1 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.6.0 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.5.1 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.5.0 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.4.7 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.4.6 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.4.5 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.4.4 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.4.3 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.4.2 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.4.1 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.4.0 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.3.4 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.3.3 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.3.0 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.2.1 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.2.0 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.1.0 app/controllers/adminpanel/sections_controller.rb
adminpanel-3.0.0 app/controllers/adminpanel/sections_controller.rb