Skip to content

Instantly share code, notes, and snippets.

@sushant12
Created June 3, 2017 06:08
Show Gist options
  • Save sushant12/834ebcf560154e94519325c8858464c6 to your computer and use it in GitHub Desktop.
Save sushant12/834ebcf560154e94519325c8858464c6 to your computer and use it in GitHub Desktop.
class TasksController < Todo::BaseController
def index
@tasks = Task.all
render("tasks/index")
end
def edit
@task = Task.where(params["id"])
render("tasks/edit")
end
def update
Task.update(params['task'], params['finished'], params['id'])
redirect_to '/'
end
def destroy
Task.delete(params['id'])
redirect_to '/'
end
def save
Task.save(params["task"])
redirect_to "/"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment