Sha256: a108643bf08959caf1b7d56ff124341fbf7aba155fb3e8410bcb3f95adedd825
Contents?: true
Size: 1.11 KB
Versions: 3
Compression:
Stored size: 1.11 KB
Contents
module Adminpanel class SectionsController < Adminpanel::ApplicationController # def new # @section = Section.new # authorize! :create, @section # end def edit @section = Section.find(params[:id]) # respond_to do |format| # format.html # format.json {render :json => {:section => @section }} # end end def update @section = Section.find(params[:id]) if @section.update_attributes(params[:section]) redirect_to section_path(@section), :notice => 'La seccion se ha actualizado' else render 'edit' end end def show @section = Section.find(params[:id]) end # def destroy # @section = Section.find(params[:id]) # @section.destroy # redirect_to sections_path # end def index @sections = Section.all end private def section_params params.require(:section).permit( :has_description, :description, :key, :page, :name, :has_image, { images_attributes: [:id, :file, :_destroy] } ) end end end
Version data entries
3 entries across 3 versions & 1 rubygems