Pipes - Irene and Sairagul - RideShare#18
Open
sairagula wants to merge 84 commits into
Open
Conversation
…nding_of_caller and pry_rails to Gemfile
| if counter > 0 | ||
| return (result/counter) | ||
| else | ||
| return "no rating" |
There was a problem hiding this comment.
It is fine to return a string here - but is there a way you could normalize the returned data type and provide a numeric result that would represent "no rating"?
| end | ||
|
|
||
| def average_rating | ||
| ratings = Trip.where(driver_id: id) |
There was a problem hiding this comment.
When this method is called, you have access to a specific driver instance. Any Driver instance should already have a "dot method" which will give you access to the trips for that driver. You should be using this functionality instead of reaching out from the Trip object.
| <section> | ||
| <%= render partial: "error" %> | ||
| <%# See _error.html.erb under drivers views for partial %> | ||
| <%= render partial: "form", locals: { button_text: "Make Driver Changes" } %> |
There was a problem hiding this comment.
Nice job using partials for the form and errors
| <%= form_for @trip do |f| %> | ||
| <div class="form-box-wrapper"> | ||
| <%= f.label :rating %> | ||
| <%= f.select(:rating, options_for_select([['1 star', 1], ['2 stars', 2], ['3 stars', 3], ['4 stars', 4], ['5 stars', 5]])) %> |
There was a problem hiding this comment.
It would be good to have this ratings array in the model or in the controller rather than in view.
Rideshare-RailsWhat We're Looking For
|
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