Sha256: 90bab04a7fa9e85a67a640270edd425f7eec1b78aa95696a93913d1c66f766d1
Contents?: true
Size: 793 Bytes
Versions: 11
Compression:
Stored size: 793 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, { sectionfiles_attributes: [ :id, :file, :_destroy ] } ) end end end
Version data entries
11 entries across 11 versions & 1 rubygems