Carets -- Laura & Victoria#20
Open
vsawchuk wants to merge 41 commits into
Open
Conversation
* Update routes to convention over configuration
…w passenger or driver
…f passenger_index_path
…to combine styling and db changes
Rideshare-RailsWhat We're Looking For
|
CheezItMan
reviewed
Oct 7, 2017
|
|
||
| def new | ||
| driver_id = find_driver() | ||
| @trip = Trip.new(date: Date.today, cost: rand(100..2000), driver_id: driver_id, passenger_id: params[:passenger_id], rating: nil) |
There was a problem hiding this comment.
This makes a good place to use strong params.
| @passenger = Passenger.find_by(id: params[:id].to_i) | ||
| redirect_to passenger_path unless @passenger | ||
|
|
||
| if @passenger.update_attributes passenger_params |
| return params.require(:driver).permit(:name, :vin) | ||
| end | ||
|
|
||
| def rating(trips) |
| end | ||
|
|
||
| def total(trips) | ||
| return trips.sum {|trip| trip.cost} |
There was a problem hiding this comment.
Another good thing to move to the model
| <section class="user_list"> | ||
| <h1>Drivers</h1> | ||
| <p> | ||
| Our drivers are the best. Everyday carry enamel pin vape beard jean shorts artisan. Knausgaard flexitarian wolf keytar affogato, kale chips helvetica subway tile craft beer YOLO cold-pressed cliche. Sustainable +1 ugh, air plant yuccie cold-pressed humblebrag chicharrones seitan chartreuse cray jianbing. |
| <p>Please rate your last trip:</p> | ||
| <%= form_tag(rate_trip_path(id: @needs_rating.id), method: :patch, class: 'rating') do %> | ||
| <%= label_tag('Rating') %> | ||
| <div class='rating-labels'> |
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