Sockets - Rosalyn#25
Conversation
Media RankerWhat We're Looking For
|
| root 'homepages#index', as: 'home' | ||
|
|
||
| resources :works | ||
| 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.
| // | ||
| // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details | ||
| // about supported directives. //= require jquery3 | ||
| //= require popper |
There was a problem hiding this comment.
I wonder if you tested your heroku deployment, because a few of your routes are broken because of an error we made with this file. See me about how to fix the error!
When you deploy a project, it's worth taking a 5 minute tour to make sure your crud still works!
| <td><%= album.number_of_votes %></td> | ||
| <td><%= link_to "#{album.title}", work_path(album.id) %></td> | ||
| <td><%= album.creator %></td> | ||
| <td><%= album.publication_year%></td> |
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?
| end | ||
|
|
||
| def top_ten_albums | ||
| @albums = Work.where(category: 'album') |
There was a problem hiding this comment.
Repeated code here, is there any way to dry these functions up?
| def top_ten_movies | ||
| @movies = Work.where(category: 'movie') | ||
| @top_ten_movies = @movies.sort_by(&:number_of_votes).first(10) | ||
| end |
There was a problem hiding this comment.
This function is right on the edge of what I'd tell you to definitely put in the Model.
| require "test_helper" | ||
|
|
||
| describe Work do | ||
| let(:work) { Work.new(title: "some title", category: "album") } |
There was a problem hiding this comment.
This is pretty flimsy testing. You need to test the negative cases here too!
Media Ranker
Congratulations! You're submitting your assignment!
Comprehension Questions
sessionandflash? What is the difference between them?What was one thing that you gained more clarity on through this assignment? | Gained a better understanding of seeding a database.
What is the Heroku URL of your deployed application? | https://secure-fjord-99174.herokuapp.com/
Do you have any recommendations on how we could improve this project for the next cohort? | Overall its a great project. Very challenging with a short amount of time to complete it but that is not a huge negative.