Class: Adminpanel::SectionsController
- Inherits:
-
ApplicationController
- Object
- 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
redirect_to sections_path end.
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#edit ⇒ Object
def new @section = Section.new authorize! :create, @section end
10 11 12 13 14 15 16 |
# File 'app/controllers/adminpanel/sections_controller.rb', line 10 def edit @section = Section.find(params[:id]) respond_to do |format| format.html format.json {render :json => {:section => @section }} end end |
#index ⇒ Object
redirect_to sections_path end
39 40 41 |
# File 'app/controllers/adminpanel/sections_controller.rb', line 39 def index @sections = Section.all end |
#show ⇒ Object
28 29 30 |
# File 'app/controllers/adminpanel/sections_controller.rb', line 28 def show @section = Section.find(params[:id]) end |
#update ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/adminpanel/sections_controller.rb', line 18 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 |