-
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
Angela and Jamila - Rideshare Rails - Octos #31
base: master
Are you sure you want to change the base?
Conversation
Rideshare-RailsWhat We're Looking For
|
end | ||
|
||
def create | ||
driver = Driver.new(driver_params) |
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 job avoiding the unnecessary instance variable in this controller action
end | ||
|
||
def create | ||
trip_attributes = { |
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 might be worthwhile to set all of these defaults in a new model method rather than setting them all here
my_trips = self.trips | ||
total = 0 | ||
|
||
my_trips.each do |trip| |
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.
Is there a fancy enumerable method you could use to do this instead?
|
||
<% @trips.each do |trip| %> | ||
|
||
<% if trip.passenger_id == @passenger.id %> |
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.
Watch out for indentation issues here - these are all nested code tags so you'll want to indent every step of the way
@trip = Trip.find(trip) | ||
end | ||
|
||
def update |
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.
Did you run out of time in implementing this feature?
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