Open
Conversation
… I can see an error message detailing what the problem is and what I should do
API MuncherWhat We're Looking For
|
dHelmgren
reviewed
Nov 15, 2018
| Rails.application.routes.draw do | ||
| root 'recipes#home' | ||
| get 'index', to: 'recipes#index', as: 'recipes_index' | ||
| get ':uri/show', to: 'recipes#show', as: 'recipes_show' |
There was a problem hiding this comment.
Not sure why :uri is before show here. Could you use resources for the index and show pages?
| return CGI.escape(r) | ||
| end | ||
|
|
||
| def self.find_recipe(uri) |
There was a problem hiding this comment.
nice work finding a way to keep this method DRY
| test "should get index" do | ||
| get recepies_index_url | ||
| assert_response :success | ||
| end |
There was a problem hiding this comment.
This test doesn't cover all your cases.
- What happens if no search term is provided?
- What if the search returns no results?
It might also be worthwhile to add some tests around the paging parameters:
- What happens if they're absent?
- Do you get different results when they change?
- What if you send a bogus value, like a negative page number?
| <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> | ||
| </head> | ||
|
|
||
| <body> |
There was a problem hiding this comment.
You should probably have a header that can take the user back to the main page.
| <div class="card" style="width: 18rem;"> | ||
| <img class="card-img-top" src="<%=recipe.image_url%>" alt="Card image cap"> | ||
| <div class="card-body"> | ||
| <h5 class="card-title"<%=recipe.label%></h5> |
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.
API Muncher
Congratulations! You're submitting your assignment!
Comprehension Questions
lib? How would your project change if you needed to interact with more than one API (aka more than just the Edamam API)?