-
Notifications
You must be signed in to change notification settings - Fork 47
Space - Hala #36
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?
Space - Hala #36
Conversation
| # TASKS = [ | ||
| # {task: "Clean the dishes"}, | ||
| # {task: "Take out the trash"}, | ||
| # {task: "Take the kids to the park"} | ||
| # ] |
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.
| # TASKS = [ | |
| # {task: "Clean the dishes"}, | |
| # {task: "Take out the trash"}, | |
| # {task: "Take the kids to the park"} | |
| # ] |
Can be deleted
| redirect_to task_path(@task.id) | ||
| return | ||
| else | ||
| render :new |
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.
Just a suggestion, include a status code:
| render :new | |
| render :new, status: :bad_request |
| redirect_to tasks_path | ||
| return | ||
| else | ||
| render :edit |
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.
| render :edit | |
| render :edit, status: :bad_request |
| if @task.update( | ||
| completed_at: Date.today.to_s | ||
| ) | ||
| redirect_to request.referrer |
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.
Nice!
| <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> | ||
| </head> | ||
|
|
||
| <body> |
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 suggest putting navigation links here like maybe a link to create a new task, and view all tasks.
| @@ -0,0 +1,15 @@ | |||
| <%= form_with model: @task, class: 'edit-task' do |f| %> | |||
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 know this isn't required for Task List, just noting that for future projects you can DRY up this form code with a partial view.
| <div class=""> | ||
| <% @tasks.each do |task| %> | ||
| <div class="dl-horizontal"> | ||
| <% css_class = (task.completed_at.nil? || task.completed_at.empty?) ? 'nostrike' : 'strike' %> |
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 like this.
| <h1><%= @task.name %></h1> | ||
| <p>: <%= @task.description %></p> | ||
| <p> <%= @task.completed_at %></p> | ||
| <%= link_to "Edit", edit_task_path(@task), class:"btn btn-info" %> |
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 suggest using the strikethrough styling here as well.
| end | ||
| end | ||
|
|
||
| def update_completed_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.
I also like the toggle.
Task ListMajor Learning Goals/Code Review
Functional Requirements/Manual Testing
Overall Feedback
Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
SummaryNicely done, you hit all the learning goals here. I like the styling you added here. Well done. |
Task List
Congratulations! You're submitting your assignment!
Comprehension Questions