Class: Adminpanel::SectionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Adminpanel::SectionsController
- Defined in:
- app/controllers/adminpanel/sections_controller.rb
Instance Method Summary collapse
-
#edit ⇒ Object
def new @section = Section.new authorize! :create, @section end.
- #index ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Methods included from TwitterActions
Methods included from FacebookActions
#fb_choose_page, #fb_publish, #fb_save_token
Methods included from GalleryzableActions
#move_gallery_better, #move_gallery_worst
Methods included from SortableActions
#move_to_better, #move_to_worst
Methods included from RestActions
Methods included from SessionsHelper
#current_user, #current_user=, #sign_in, #sign_out, #signed_in?
Instance Method Details
#edit ⇒ Object
def new @section = Section.new authorize! :create, @section end
12 13 14 15 16 17 18 |
# File 'app/controllers/adminpanel/sections_controller.rb', line 12 def edit @section = Section.find(params[:id]) # respond_to do |format| # format.html # format.json {render :json => {:section => @section }} # end end |
#index ⇒ Object
3 4 5 |
# File 'app/controllers/adminpanel/sections_controller.rb', line 3 def index @sections = Section.all end |
#show ⇒ Object
30 31 32 |
# File 'app/controllers/adminpanel/sections_controller.rb', line 30 def show @section = Section.find(params[:id]) end |
#update ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/adminpanel/sections_controller.rb', line 20 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 |