Skip to content

Instantly share code, notes, and snippets.

@1dolinski
Last active December 18, 2015 05:39
Show Gist options
  • Select an option

  • Save 1dolinski/5733853 to your computer and use it in GitHub Desktop.

Select an option

Save 1dolinski/5733853 to your computer and use it in GitHub Desktop.
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
# controller variable
@user = User.find(1)
@articles = @user.articles.page(params[:page])
/ 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