class TasksController

Public Instance Methods

create() click to toggle source
# File lib/engine/app/controllers/tasks_controller.rb, line 18
def create
  @task = Task.create(task_params)
  redirect_to action: :index
end
destroy() click to toggle source
# File lib/engine/app/controllers/tasks_controller.rb, line 29
def destroy
  @task = Task.find(params[:id])
  @task.destroy
  redirect_to action: :index
end
edit() click to toggle source
# File lib/engine/app/controllers/tasks_controller.rb, line 14
def edit
  @task = Task.find(params[:id])
end
index() click to toggle source
# File lib/engine/app/controllers/tasks_controller.rb, line 6
def index
  @tasks = Task.all
end
new() click to toggle source
# File lib/engine/app/controllers/tasks_controller.rb, line 10
def new
  @task = Task.new
end
update() click to toggle source
# File lib/engine/app/controllers/tasks_controller.rb, line 23
def update
  @task = Task.find(params[:id])
  @task.update_attributes(task_params)
  redirect_to action: :index
end

Private Instance Methods

load_section() click to toggle source
# File lib/engine/app/controllers/tasks_controller.rb, line 36
def load_section
  @section = 'tasks'
end
reset_queue() click to toggle source
# File lib/engine/app/controllers/tasks_controller.rb, line 44
def reset_queue
  @task.reset_queue
end
task_params() click to toggle source
# File lib/engine/app/controllers/tasks_controller.rb, line 40
def task_params
  params.require(:task).permit(:name, :type, :trigger, :database, :every, :status)
end