Kiera - MediaRanker - Octos#31
Open
Krashaune wants to merge 32 commits into
Open
Conversation
…d an index view file for work
…hods to controller
…or works index page to display all works by category. Also updates works controller index with instance variables for albums, books, and movies.
… to redirect create
…ng for validations.Add fixtures for works
…r data to accept seeds.
…ed vote count to list of works tables
…Added render partial for error messages within user log in form. Added fixtures and validation tests that are passing.
…orm saving the user and rendering errors.Added new routes for sessions and methods in the controller new, create, and destroy.
… top for home page.Updated application.html.erb for logout button.
…o application.html.erb
… media content to top media page. Added header class for top of page to prep for CSS.
…html.erb and index pages.
… to singular. Added upvote route to works post. Updated todo to update upvote links with correct path.
Media RankerWhat We're Looking For
|
| post 'works/:id/upvote', to: 'works#upvote', as: 'upvote' | ||
|
|
||
| resources :users | ||
|
|
There was a problem hiding this comment.
I don't think you need all 7 restful routes for users - only index and show are needed for this project.
| <%= link_to 'Back to ranks',root_path, class:'button' %> | ||
| <%= link_to 'Edit',edit_work_path, class:'button' %> | ||
| <%= link_to 'Upvote', root_path, class:'button' %> | ||
| <%= link_to 'Delete',work_path, method: :delete, data: {confirm: "Are you sure?"}, class:'alert button'%> |
There was a problem hiding this comment.
Your upvote link goes to the wrong place!
| <section> | ||
| <h3>Top Books</h3> | ||
| <% @works.where(category: 'book').top_votes.take(10).each do |work| %> | ||
| <ul class="no-bullet"> |
There was a problem hiding this comment.
Line 20 would be great as a model method! Maybe something like self.top_ten(category), so that here (or in the controller) you could say Work.top_ten('book').
| <h3>Music Albums</h3> | ||
| <table> | ||
|
|
||
| <th> |
There was a problem hiding this comment.
You have the same code to show a list of works repeated 3 times. Could you use a view partial or a loop to DRY this up?
| require "test_helper" | ||
|
|
||
| describe Vote do | ||
| end |
There was a problem hiding this comment.
You should be testing the uniqueness constraint here! Specific test cases I'd want to see:
- A user can have votes for two different works
- A work can have votes from two different users
- A user cannot vote for the same work twice
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.
Media Ranker
Congratulations! You're submitting your assignment!
Comprehension Questions
sessionandflash? What is the difference between them?