Class: RushJobMongoid::RushJobsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- RushJobMongoid::RushJobsController
- Defined in:
- app/controllers/rush_job_mongoid/rush_jobs_controller.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
29 30 31 32 33 34 |
# File 'app/controllers/rush_job_mongoid/rush_jobs_controller.rb', line 29 def destroy @job.destroy flash[:success] = t(:deleted_job, job_id: @job.id) redirect_to rush_jobs_path end |
#edit ⇒ Object
15 16 17 |
# File 'app/controllers/rush_job_mongoid/rush_jobs_controller.rb', line 15 def edit flash.now[:warning] = t(:edit_warning) end |
#index ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/controllers/rush_job_mongoid/rush_jobs_controller.rb', line 5 def index @pagination_presenter = PaginationPresenter.new(params[:page]) @rush_jobs = RushJob.filter(filter_params).locked_by_desc.paginate(@pagination_presenter.page, 20) respond_to do |format| format.html format.turbo_stream end end |
#update ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/rush_job_mongoid/rush_jobs_controller.rb', line 19 def update if @job.update(update_params) flash[:success] = t(:updated_job, job_id: @job.id) redirect_to rush_jobs_path(doc_id: @job.id) else flash.now[:danger] = t(:unable_to_update, errors: @job.) render :edit, status: :unprocessable_entity end end |