Class: Adminpanel::SectionsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Adminpanel::SectionsController
- Defined in:
- app/controllers/adminpanel/sections_controller.rb
Instance Method Summary collapse
-
#edit ⇒ Object
if @section.save redirect_to section_path(@section), :notice => 'La seccion ha sido creada' else render 'new' end end.
-
#index ⇒ Object
redirect_to sections_path end.
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#edit ⇒ Object
if @section.save redirect_to section_path(@section), :notice => 'La seccion ha sido creada' else render 'new' end end
17 18 19 |
# File 'app/controllers/adminpanel/sections_controller.rb', line 17 def edit @section = Section.find(params[:id]) end |
#index ⇒ Object
redirect_to sections_path end
42 43 44 |
# File 'app/controllers/adminpanel/sections_controller.rb', line 42 def index @sections = Section.all end |
#new ⇒ Object
3 4 5 |
# File 'app/controllers/adminpanel/sections_controller.rb', line 3 def new @section = Section.new end |
#show ⇒ Object
31 32 33 |
# File 'app/controllers/adminpanel/sections_controller.rb', line 31 def show @section = Section.find(params[:id]) end |
#update ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/adminpanel/sections_controller.rb', line 21 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 |