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
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
Methods inherited from ApplicationController
#get_menu_elements, #handle_unverified_request, #set_model, #signed_in_user
Methods included from RouterHelper
#adminpanel_resources, #default_controllers, #find_resources, #menu_items, #resources_path
Methods included from RestActionsHelper
Methods included from SessionsHelper
#current_user, #current_user=, #sign_in, #sign_out, #signed_in?
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 |