Skip to content

Conversation

@veralizeth
Copy link

Task List

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe in your own words what the Model is doing in Rails Handle the ruby classes and handle the data, for the Task app it handles the Database)
Describe in your own words what the Controller is doing in Rails It gets all the data from the model passes into the views, also receive all the event from the views.
Describe in your own words what the View is doing in Rails It turns data into HTML, just render information that gets from the controller.
Describe an edge-case controller test you wrote redirect to the root page if given an invalid id.
What is the purpose of using strong params? (i.e. the params method in the controller) DRY
How are Rails migrations related to Rails models? The migrations are related to the tables we created. in this case Task is our class model related to our books schema.
Describe one area of Rails that are still unclear on Controller actions and testing.

dHelmgren and others added 30 commits September 30, 2019 14:54
Students think that they should create an action that toggles. I think we should change this to describe "mark_complete" do.
@kaidamasaki
Copy link

Task List

Major Learning Goals/Code Review

Criteria yes/no, and optionally any details/lines of code to reference
At least 6 commits with meaningful commit messages ✔️
Routes follow RESTful conventions ✔️
Uses named routes (like _path) ✔️
Creates Models and migrations ✔️
Creates styled views No styles.
Handles errors like nonexistant tasks ✔️
Uses form_with to render forms in Rails ✔️

Functional Requirements/Manual Testing

Functional Requirement yes/no
Successfully handles index & show ✔️
index & show tests pass ✔️
Successfully handles: New, Create ✔️
New, Create tests pass ✔️
Successfully handles: Edit, Update ✔️
Successfully handles: Destroy, Task Complete ✔️

Overall Feedback

Overall Feedback Criteria yes/no
Green (Meets/Exceeds Standards) 5+ in Code Review && 5+ in Functional Requirements
Yellow (Approaches Standards) 3+ in Code Review && 4+ in Functional Requirements, or the instructor judges that this project needs special attention
Red (Not at Standard) 0-2 in Code Review or 0-3 in Functional Reqs, or assignment is breaking/doesn’t run with less than 5 minutes of debugging, or the instructor judges that this project needs special attention

Code Style Bonus Awards

Was the code particularly impressive in code style for any of these reasons (or more...?)

Quality Yes?
Perfect Indentation
Elegant/Clever
Descriptive/Readable
Concise
Logical/Organized

Copy link

@kaidamasaki kaidamasaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! Just one suggestion on how to improve your future designs. 😃

Comment on lines +68 to +84
def completed_at
task_id = params[:id]
task = Task.find_by(id: task_id)

if task.nil?
head :not_found
return
elsif task.completed_at
task.completed_at = nil
else
time = Time.now
task.completed_at = time.strftime("%d of %B, %Y")
end

task.save
redirect_to tasks_path
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd generally recommend splitting actions like this into two parts in the future. One to mark complete and one to mark incomplete.

One reason is that things can get confusing if the user's computer or internet is slow. If the page takes a while to load and the user clicks the button several times you could get several requests that could potentially cancel each other out.

Where as if your endpoint doesn't toggle back and forth your task will just be marked complete several times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants