-
Notifications
You must be signed in to change notification settings - Fork 47
Time - Yaz #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Time - Yaz #47
Conversation
…rb. Created basic, corresponding erb view and css.
… and corresponding views for show + index views.
… create and new, and coressponding route. Link to add new task is now at the bottom of index page.
Task ListMajor Learning Goals/Code Review
Functional Requirements/Manual Testing
Overall Feedback
|
| create_table :lists do |t| | ||
| t.string :name | ||
|
|
||
| t.timestamps |
There was a problem hiding this comment.
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.
| <%= 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" %> |
There was a problem hiding this comment.
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.
app/controllers/tasks_controller.rb
Outdated
| end | ||
|
|
||
| def format_datetime(datetime_string) | ||
| time_array = datetime_string.split(/\D/) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
jmaddox19
left a comment
There was a problem hiding this 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' |
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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.
Task List
Congratulations! You're submitting your assignment!
Comprehension Questions