Sha256: 7bf2b3c89372ac6d310514c919f40fad463950114075b9d7babc4ffdb1c77725

Contents?: true

Size: 1.07 KB

Versions: 3

Compression:

Stored size: 1.07 KB

Contents

module Adminpanel
  class SectionsController < Adminpanel::ApplicationController
    load_and_authorize_resource

    def new
      @section = Section.new
    end

    # def create
    #   @section = Section.new(params[:section])

    #   if @section.save
    #     redirect_to section_path(@section), :notice => 'La seccion ha sido creada'
    #   else
    #     render 'new'
    #   end
    # 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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
adminpanel-1.2.12 app/controllers/adminpanel/sections_controller.rb
adminpanel-1.2.11 app/controllers/adminpanel/sections_controller.rb
adminpanel-1.2.10 app/controllers/adminpanel/sections_controller.rb