Skip to content

Conversation

@saintmedusa
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 The model is keeping track of task attributes (via columns), individual task records (rows) and changes to the way we keep track of tasks.
Describe in your own words what the Controller is doing in Rails the controller is processing the data that comes in when the user interacts with the view.
Describe in your own words what the View is doing in Rails The view is displaying information and options to the user.
Describe an edge-case controller test you wrote didn't write tests
What is the purpose of using strong params? (i.e. the params method in the controller) I don't have a params method
How are Rails migrations related to Rails models? migrations keekp track of changes to the database, and are the method for creating change
Describe one area of Rails that are still unclear on params

@dHelmgren
Copy link

dHelmgren commented May 20, 2020

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 ✔️ (You made a list controller and IDK why, as it isn't in reqs)
Creates styled views
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 fails because there is no way to set the List from the task#new controller. I had to manually create a List to make the other routes work. The form doesn't let me add a list.
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 ✔️

Comment on lines 3 to 6
create_table :lists do |t|
t.string :name

t.timestamps

Choose a reason for hiding this comment

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

Not sure why this is here, it causes problems in your create route.

Comment on lines +2 to +15
<%= form_with model: @task do |f| %>

<%= f.label :name %>
<%= f.text_field :name %>

<%= f.label :description %>
<%= f.text_field :description %>

<%if @task.completed%>
<%= f.label :completed_at%>
<%= f.datetime_field :completed_at%>
<%end%>

<%= f.submit "update task" %>

Choose a reason for hiding this comment

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

This is a good place to use a form partial.

end

def format_datetime(datetime_string)
time_array = datetime_string.split(/\D/)

Choose a reason for hiding this comment

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

I'm getting the following error when trying to edit a task: undefined method 'split' for nil:NilClass
It's pointing at this line.

end
end

def mark_complete

Choose a reason for hiding this comment

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

I haven't figured out why but this is not succeeding for me in updating the task to complete.

def show
@task = Task.find_by(id: params[:id])
if @task.nil?
head :not_found
Copy link

@jmaddox19 jmaddox19 May 20, 2020

Choose a reason for hiding this comment

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

Devin marked the project as not handling non-existent tasks because the thing most people did here was a redirect but this is fine for now as well.
For MediaRanker, we will want to do a redirect in addition to flash messages to keep the user on a functioning page while also giving clear messaging to the user that what they were looking for is not there.

Copy link

@jmaddox19 jmaddox19 left a comment

Choose a reason for hiding this comment

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

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 but not required
Handles errors like nonexistant tasks Sort of, but not with a redirect like the later lessons recommend. For MediaRanker, we will want to do a redirect in addition to flash messages to keep the user on a functioning page while also giving clear messaging to the user that what they were looking for is not there.
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

get '/tasks/:id', to: 'tasks#show', as: 'task'
get '/tasks/:id/edit', to: 'tasks#edit', as: 'edit_task'
patch '/tasks/:id', to: 'tasks#update'
patch '/tasks.:id', to: 'tasks#mark_complete', as: 'mark_complete'

Choose a reason for hiding this comment

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

This totally still works because the code uses the alias but I think you intended for this to be a / instead of a .

@@ -1,3 +1,14 @@
Rails.application.routes.draw do
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
# collection of tasks

Choose a reason for hiding this comment

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

In the future, it'll be important to have a root path to make your application more user-friendly.
Right now, I need to know to navigate to the /tasks path to be able to use the site.

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.

3 participants