Class: TasksController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- TasksController
- Defined in:
- lib/engine/app/controllers/tasks_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
18 19 20 21 |
# File 'lib/engine/app/controllers/tasks_controller.rb', line 18 def create @task = Task.create(task_params) redirect_to action: :index end |
#destroy ⇒ Object
29 30 31 32 33 |
# 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 ⇒ Object
14 15 16 |
# File 'lib/engine/app/controllers/tasks_controller.rb', line 14 def edit @task = Task.find(params[:id]) end |
#index ⇒ Object
6 7 8 |
# File 'lib/engine/app/controllers/tasks_controller.rb', line 6 def index @tasks = Task.all end |
#new ⇒ Object
10 11 12 |
# File 'lib/engine/app/controllers/tasks_controller.rb', line 10 def new @task = Task.new end |
#update ⇒ Object
23 24 25 26 27 |
# 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 |