Skip to content
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

Emily's API Muncher #87

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Emily's API Muncher #87

wants to merge 18 commits into from

Conversation

eabrash
Copy link

@eabrash eabrash commented Nov 7, 2016

@eabrash eabrash changed the title Emily Emily's API Muncher Nov 7, 2016
Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eabrash Hello Emily, very nice job overall with your API-Muncher project. It's a beautiful site with all the required functionality. You also did a good job with testing.

I've included some comments in the pull request here, and a summary in your Progress report at: https://docs.google.com/document/d/1SL6czRQKGmbms1JTES6Kjl6qNbk-YWhW9KfBDl9vFME/edit

end

def show
@page = 'nonhomepage'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about if the show page is missing some of those parameters? Like the from parameter is missing?


get 'recipes/show/:id' => 'recipes#show', as: 'recipes_show'

# The priority is based upon order of creation: first created -> highest priority.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be cleaned up a bit, the paths are all over the place for one type of thing. For someone looking at your routes from the outside they would have trouble figuring out which route did which thing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this great feedback Chris - you are totally right that the routes were messy and difficult to follow. I've put in a little more time cleaning them up, but would love to talk with you about best practices regarding the relationship between route names and controllers/controller methods. Maybe we can discuss this in our next 1:1 meeting :)

if recipe_hash['label'] == nil || recipe_hash['uri'] == nil || recipe_hash['label'] == "" || recipe_hash['uri'] == "" || recipe_hash['ingredients'] == nil || recipe_hash['ingredients'].length == 0 || recipe_hash['source'] == nil || recipe_hash['source'] == ""
raise ArgumentError
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good check for missing required arguments.

}]})
end
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could probably do the ArgumentError testing with a loop like we did in class.


config.filter_sensitive_data("<EDAMAM_CLIENT_SECRET>") do
ENV['EDAMAM_CLIENT_SECRET']
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work hiding your keys from github and the cassets!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants