You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
It's currently not possible to have a query string parameter like distance, as it would most probably cause scrivener_html to raise ArithmeticError or at least have some undesired side-effect.
This is due to the fact that there is no distinction between pagination_links's own keywords and the possible query string parameter we can provide.
The workaround I found was to have a separate data structure with my query parameters, and to use the :path parameter to point not directly to a route helper but to another function, which will take the initial @conn and my data structure and make the call to the route helper.
Would it be possible to accept an anonymous function for example, which would be called with just the pagination parameters?
This would help keep a clean API, and even maybe remove the @conn parameter (as far as I can tell it's only used for the path, but is passed around all the way to raw_pagination_links...)
If this is OK for you I can try to implement this, but it may induce an API change, hence the discussion.
The text was updated successfully, but these errors were encountered:
In order to preserve the current API, we could instead just accept a query option and everything in there would get merged as query string parameters in addition to the existing implementation for backwards compatibility. What do you think about that instead?
If you think that is acceptable, I'd be willing to accept a PR for it.
Hi!
It's currently not possible to have a query string parameter like
distance
, as it would most probably cause scrivener_html to raiseArithmeticError
or at least have some undesired side-effect.This is due to the fact that there is no distinction between
pagination_links
's own keywords and the possible query string parameter we can provide.The workaround I found was to have a separate data structure with my query parameters, and to use the
:path
parameter to point not directly to a route helper but to another function, which will take the initial@conn
and my data structure and make the call to the route helper.Would it be possible to accept an anonymous function for example, which would be called with just the pagination parameters?
This would help keep a clean API, and even maybe remove the
@conn
parameter (as far as I can tell it's only used for the path, but is passed around all the way to raw_pagination_links...)If this is OK for you I can try to implement this, but it may induce an API change, hence the discussion.
The text was updated successfully, but these errors were encountered: