Fix #2: Top Month Always Empty (archives_sidebar) #33
Open
tbduong wants to merge 2 commits intosf-wdi-30:masterfrom
Open
Fix #2: Top Month Always Empty (archives_sidebar) #33tbduong wants to merge 2 commits intosf-wdi-30:masterfrom
tbduong wants to merge 2 commits intosf-wdi-30:masterfrom
Conversation
| <% unless sidebar.archives.blank? %> | ||
| <h3 class="sidebar_title"><%= sidebar.title %></h3> | ||
| <div class="sidebar_body"> | ||
| <h3 class="sidebar-title"><%= sidebar.title %></h3> |
There was a problem hiding this comment.
How are these class changes relevant to the ordering of articles?
|
Nice catch that the route doesn't match! |
ba6de60 to
9bdaaeb
Compare
Author
|
Would the route need to get corrected for the pull request accept? Or are we okay to merge? |
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.
Fix for issue #2.
Issue: The top month of the archive month is always empty.
In archives_sidebar/_content.html.erb, line 8. Resolved-- by deleting +1 :
<%= link_to"#{month[:name]} #{counter}".html_safe, articles_by_month_path( month[:year], "%02i" % (month[:month]) +1 ) %><%= link_to"#{month[:name]} #{counter}".html_safe, articles_by_month_path( month[:year], "%02i" % (month[:month]) ) %>This line included a +1 to month. This resulted in an off-by-1 error, which essentially pulls in article(s) from the NEXT month, which have not yet been published. By removing the +1, the top month is no longer empty. (although now I see a routing issue, where the month # in the route does not match the # of the current month.