-
Notifications
You must be signed in to change notification settings - Fork 42
Kiera - MediaRanker - Octos #31
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
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Media Ranker
Congratulations! You're submitting your assignment!
Comprehension Questions
sessionandflash? What is the difference between them?