Class: Naf::LoggerStylesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Naf::LoggerStylesController
- Defined in:
- app/controllers/naf/logger_styles_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/naf/logger_styles_controller.rb', line 27 def create @logger_style = Naf::LoggerStyle.new(params[:logger_style]) if @logger_style.save redirect_to(@logger_style, notice: "Logger Style '#{@logger_style.name}' was successfully created.") else render action: "new" end end |
#destroy ⇒ Object
15 16 17 18 19 20 |
# File 'app/controllers/naf/logger_styles_controller.rb', line 15 def destroy @logger_style = Naf::LoggerStyle.find(params[:id]) @logger_style.destroy flash[:notice] = "Logger Style '#{@logger_style.name}' was successfully deleted." redirect_to(action: "index") end |
#edit ⇒ Object
37 38 39 |
# File 'app/controllers/naf/logger_styles_controller.rb', line 37 def edit @logger_style = Naf::LoggerStyle.find(params[:id]) end |
#index ⇒ Object
6 7 8 9 |
# File 'app/controllers/naf/logger_styles_controller.rb', line 6 def index @rows = Naf::LoggerStyle.all render template: 'naf/datatable' end |
#new ⇒ Object
22 23 24 25 |
# File 'app/controllers/naf/logger_styles_controller.rb', line 22 def new @logger_style = Naf::LoggerStyle.new @logger_style.logger_style_names.build end |
#show ⇒ Object
11 12 13 |
# File 'app/controllers/naf/logger_styles_controller.rb', line 11 def show @logger_style = Naf::LoggerStyle.find(params[:id]) end |
#update ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'app/controllers/naf/logger_styles_controller.rb', line 41 def update @logger_style = Naf::LoggerStyle.find(params[:id]) if @logger_style.update_attributes(params[:logger_style]) redirect_to(@logger_style, notice: "Logger Style '#{@logger_style.name}' was successfully updated.") else render action: "edit" end end |