Sha256: 5987e67c57dbd12a48c647f4b59faeae8cf789813bbdfdb3d43339be018169f6

Contents?: true

Size: 988 Bytes

Versions: 12

Compression:

Stored size: 988 Bytes

Contents

module Adminpanel
  class SectionsController < Adminpanel::ApplicationController
    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])
    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

12 entries across 12 versions & 1 rubygems

Version Path
adminpanel-0.1.1 app/controllers/adminpanel/sections_controller.rb
adminpanel-0.1.0cl.2 app/controllers/adminpanel/sections_controller.rb
adminpanel-0.1.0cl app/controllers/adminpanel/sections_controller.rb
adminpanel-0.1.0 app/controllers/adminpanel/sections_controller.rb
adminpanel-0.0.7 app/controllers/adminpanel/sections_controller.rb
adminpanel-0.0.6.1 app/controllers/adminpanel/sections_controller.rb
adminpanel-0.0.6 app/controllers/adminpanel/sections_controller.rb
adminpanel-0.0.5 app/controllers/adminpanel/sections_controller.rb
adminpanel-0.0.4 app/controllers/adminpanel/sections_controller.rb
adminpanel-0.0.3 app/controllers/adminpanel/sections_controller.rb
adminpanel-0.0.2 app/controllers/adminpanel/sections_controller.rb
adminpanel-0.0.1 app/controllers/adminpanel/sections_controller.rb