Class: Adminpanel::SectionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/adminpanel/sections_controller.rb

Instance Method Summary collapse

Methods included from GalleryActions

#add_to_gallery, #remove_image

Methods included from FacebookActions

#fb_choose_page, #fb_publish, #fb_save_token

Methods included from SortableActions

#move_to_position

Methods included from RestActions

#create, #destroy, #new, #show

Methods included from SessionsHelper

#current_user, #current_user=, #sign_in, #sign_out, #signed_in?

Instance Method Details

#editObject



7
8
9
# File 'app/controllers/adminpanel/sections_controller.rb', line 7

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

#indexObject



3
4
5
# File 'app/controllers/adminpanel/sections_controller.rb', line 3

def index
  @sections = Section.all
end

#updateObject



11
12
13
14
15
16
17
18
19
# File 'app/controllers/adminpanel/sections_controller.rb', line 11

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