Skip to content

Instantly share code, notes, and snippets.

@AkiraBrand
Created October 1, 2018 02:53
Show Gist options
  • Save AkiraBrand/07cf8e63cae285da9682b8b417ae7b52 to your computer and use it in GitHub Desktop.
Save AkiraBrand/07cf8e63cae285da9682b8b417ae7b52 to your computer and use it in GitHub Desktop.
task_manager_cfu gist
CRUD stands for create, read, update and destroy.
We use set method_override: true to allow us to use _method in the form
the name is going into the task's parameters and pulling out whats associated title (setting it to name)
the value is calling the title method on a ruby object, task.
params is a hash. in the case of this exercise, its a hash that holds a key, and value, another hash with the title and description. It was made this way beause of how we named the input fields in the forms we made, and what we typed into them.
I'm assuming that we need different routes because each command does an entirely different thing, especially in regards to your database. You wouldn't use the same route to do two separate functions on opposite sides of a huge library, so why would that be the case with a computer? It would be inefficient.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment