Last active
December 18, 2015 05:39
-
-
Save 1dolinski/5733853 to your computer and use it in GitHub Desktop.
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
| error: | |
| No error without the view portion and can do ... route?page=2 | |
| however when adding in the view it gets a no route error |
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
| # controller variable | |
| @user = User.find(1) | |
| @articles = @user.articles.page(params[:page]) | |
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
| / view | |
| - if @articles.previous_page | |
| = link_to "< Previous", params.merge(page: @articles.previous_page) | |
| Page #{@articles.current_page} of #{@articles.total_pages} | |
| - if @articles.next_page | |
| = link_to "Next >", params.merge(page: @articles.next_page) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment