Space - Katie#52
Conversation
…d in, and to see current user info and log out if logged in
…ethod in work model to count total votes" ;
… to user controller
… model and updated the homepages view and controller
Media RankerFunctional Requirements: Manual Testing
Major Learning Goals/Code Review
Previous Rails learning, Building Complex Model Logic, DRYing up Rails Code
Testing Rails Apps
Overall Feedback
Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
|
kaidamasaki
left a comment
There was a problem hiding this comment.
Great job! You missed a few small things (you can make better use of view partials and should go over controller filters again) but overall this was a really good solution. 😃
| @work = Work.find_by(id: params[:id]) | ||
| if @work.nil? | ||
| head :not_found | ||
| return | ||
| end |
There was a problem hiding this comment.
This logic is repeated several times and should be placed in a controller filter to DRY up your code.
| <p class="spotlight__description"><%=@top_work.num_votes%> votes - | ||
| </p> |
There was a problem hiding this comment.
Your indentation is a little funky in some places.
| </thead> | ||
|
|
||
| <tbody> | ||
| <% @works.where(category: category).sort_by{|work| work.num_votes}.reverse.each do |work| %> |
There was a problem hiding this comment.
This logic should have been in your model or a view helper.
| resources :users | ||
| resources :votes |
There was a problem hiding this comment.
Remember, unless you implement all 7 actions you should exclude unused ones in your routes.
Media Ranker
Congratulations! You're submitting your assignment!
Comprehension Questions
sessionandflash? What is the difference between them?Assignment Submission: Media Ranker
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection
sessionandflash? What is the difference between them?