Class: Wco::LogsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Wco::LogsController
- Defined in:
- app/controllers/wco/logs_controller.rb
Instance Method Summary collapse
- #bulkop ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #update ⇒ Object
Instance Method Details
#bulkop ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'app/controllers/wco/logs_controller.rb', line 4 def bulkop @logs = Wco::Log.find params[:ids] :delete, @logs case params[:verb] when 'delete' @logs.map &:delete end flash_notice "Probably ok" redirect_to request.referrer end |
#create ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/wco/logs_controller.rb', line 15 def create @log = Wco::Log.new( params[:log].permit! ) :create, @log if @log.save flash_notice @log else flash_alert @log end redirect_to action: :index end |
#destroy ⇒ Object
27 28 29 30 31 32 33 |
# File 'app/controllers/wco/logs_controller.rb', line 27 def destroy @log = Wco::Log.find params[:id] :delete, @log @log.delete flash_notice "Probably ok" redirect_to action: :index end |
#edit ⇒ Object
39 40 41 42 |
# File 'app/controllers/wco/logs_controller.rb', line 39 def edit @log = Wco::Log.find params[:id] :edit, @log end |
#index ⇒ Object
44 45 46 47 48 |
# File 'app/controllers/wco/logs_controller.rb', line 44 def index :index, Wco::Log @logs = Wco::Log.all.page( params[:logs_page] ).per( current_profile.per_page ) render '_index' end |