Class: Guts::NavigationsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Guts::NavigationsController
- Defined in:
- app/controllers/guts/navigations_controller.rb
Overview
Navigations ontroller
Instance Method Summary collapse
-
#create ⇒ Object
Creates a navigation through post.
-
#destroy ⇒ Object
Destroys a single navigation.
-
#edit ⇒ Object
Editing of a navigartion.
-
#index ⇒ Object
Displays a list of navigations.
-
#new ⇒ Object
Creation of a new navigation.
-
#show ⇒ Object
Shows details about a single navigation.
-
#update ⇒ Object
Updates a navigation through patch.
Methods included from MultisiteConcern
#current_site, #with_current_site
Methods included from SessionsHelper
#current_user, #log_in, #log_out, #logged_in?
Instance Method Details
#create ⇒ Object
Note:
Redirects to #index if successfull or re-renders #new if not
Creates a navigation through post
28 29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/guts/navigations_controller.rb', line 28 def create @navigation = Navigation.new if @navigation.save flash[:notice] = 'Navigation was successfully created.' redirect_to else render :new end end |
#destroy ⇒ Object
Note:
Redirects to #index on success
Destroys a single navigation
52 53 54 55 56 57 |
# File 'app/controllers/guts/navigations_controller.rb', line 52 def destroy @navigation.destroy flash[:notice] = 'Navigation was successfully destroyed.' redirect_to end |
#edit ⇒ Object
Editing of a navigartion
23 24 |
# File 'app/controllers/guts/navigations_controller.rb', line 23 def edit end |
#index ⇒ Object
Displays a list of navigations
9 10 11 |
# File 'app/controllers/guts/navigations_controller.rb', line 9 def index @navigations = Navigation.all end |
#new ⇒ Object
Creation of a new navigation
18 19 20 |
# File 'app/controllers/guts/navigations_controller.rb', line 18 def new @navigation = Navigation.new end |
#show ⇒ Object
Shows details about a single navigation
14 15 |
# File 'app/controllers/guts/navigations_controller.rb', line 14 def show end |
#update ⇒ Object
Note:
Redirects to #index if successfull or re-renders #edit if not
Updates a navigation through patch
41 42 43 44 45 46 47 48 |
# File 'app/controllers/guts/navigations_controller.rb', line 41 def update if @navigation.update() flash[:notice] = 'Navigation was successfully updated.' redirect_to else render :edit end end |