-
Notifications
You must be signed in to change notification settings - Fork 24
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
Ampers Leti and Steffany #13
base: master
Are you sure you want to change the base?
Conversation
…views/drivers/show
Rideshare-RailsWhat We're Looking For
NOTE:: You did a PR from Leti's branch |
@@ -0,0 +1,2 @@ | |||
<h1>Trips#show</h1> |
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 deleting unused files like these, is preferred.
@@ -0,0 +1,3 @@ | |||
class Driver < ApplicationRecord | |||
has_many :trips |
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.
No validations?
@@ -0,0 +1,3 @@ | |||
class Passenger < ApplicationRecord | |||
has_many :trips |
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.
No validations?
<% @drivers.each do |driver| %> | ||
|
||
<ul > | ||
<li> <img src="https://via.placeholder.com/50x50" /> <%= link_to driver.name, show_driver_path(driver[:id]) %> <%= link_to "Edit", edit_driver_path(driver[:id]) %> <%= link_to "Delete", delete_driver_path(driver[:id]), method: :delete %></li> |
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.
It's human nature to want to click on the driver's image as well as the name, so making that a link would be nice.
@rating == 0 ? "Driver has no trips" : @rating = @rating/number_of_ratings | ||
|
||
# Calculate total earnings: | ||
@total_earnings = 0 |
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.
All this logic should be done in the model.
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
Link
Link