Last active
August 29, 2015 14:11
-
-
Save twined/e8305f2f8ceec10853ed to your computer and use it in GitHub Desktop.
Phoenix Pagination
This file contains 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
# in template | |
<%= next_page_path({:user_path, [:index]}, @current_page, @conn.params %> | |
# in view | |
def next_page_path({cur_path, helper_args}, cur_page, params \\ []) do | |
params = Dict.merge(params, %{"page" => cur_page + 1}) | |
apply(MyApp.Router.Helpers, cur_path, helper_args ++ [params]) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment