Carets -- Stef & Guille: made rails app#4
Open
murog wants to merge 35 commits into
Open
Conversation
…o divide all costs by 100
… passenger on their page
… lack of commits.
Rideshare-RailsWhat We're Looking For
|
|
tildeee
reviewed
Oct 15, 2017
| trips.each do |trip| | ||
| total += trip.rating | ||
| end | ||
| return "#{(total / trip_count).round(2)}" |
There was a problem hiding this comment.
What happens if there are no trips associated with a driver? Then total would be 0.0 and trip_count is 0. Ruby evaluates 0.0 / 0 as NaN or "Not A Number." When it gets to the driver/show.html.erb view, NaN.to_s evaluates to just "NaN" so it shows up on the driver page as "NaN" on the page. It'll show up like this:
"Minnie Dach
Average rating is NaN out of 5."
tildeee
reviewed
Oct 15, 2017
| </ul> | ||
| <% end %> | ||
| <% end %> | ||
| <% else %> |
There was a problem hiding this comment.
please practice proper indentation in your view files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rideshare-Rails
Congratulations! You're submitting your assignment! These comprehension questions should be answered by both partners together, not by a single teammate.
Comprehension Questions