Skip to content

Instantly share code, notes, and snippets.

@vaidashi
Created June 27, 2017 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vaidashi/b3c98ed767f570866b9da9dc10d8d855 to your computer and use it in GitHub Desktop.
Save vaidashi/b3c98ed767f570866b9da9dc10d8d855 to your computer and use it in GitHub Desktop.
CRUD
Define CRUD.
It allows you to create and view tasks, along with editing and deleting them afterwards.
Why do we use set method_override: true?
To allow access to hidden methods within HTML.
Explain the difference between value and name in this line: <input type='text' name='task[title]' value="<%= @task.title %>"/>.
Value is setting/updating the key/value within ruby and database. Name is setting what the input will be.
What are params? Where do they come from?
It's something built in Sinatra and deals with user/client submission data and it's storage and retrieval.
Check out your routes. Why do we need two routes each for creating a new Task and editing an existing Task?
SRP, to make our program function effectively in a clear and understandable way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment