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
Nothing is technically "broken" because of this, but for example, to add support for multiple pagy's on one html page (e.g. for several lists of things on different tabs), I ended up having to do a dirty and override the pagy_link_proc method in my application_helper:
# Return a performance optimized proc to generate the HTML links# Benchmarked on a 20 link nav: it is ~22x faster and uses ~18x less memory than rails' link_todefpagy_link_proc(pagy,link_extra: '')p_prev=pagy.prevp_next=pagy.nextopen_tab=pagy.vars[:open_tab].present? ? %(&open_tab=#{pagy.vars[:open_tab]}) : ''left,right=%(<a href="#{pagy_url_for(pagy,PAGE_PLACEHOLDER,html_escaped: true)}#{open_tab}" #{pagy.vars[:link_extra]}#{link_extra}).split(PAGE_PLACEHOLDER,2)lambdado |page,text=pagy.label_for(page),extra_attrs=''|
%(#{left}#{page}#{right}#{casepagewhenp_prevthen' rel="prev"'whenp_nextthen' rel="next"'else''end}#{extra_attrs}>#{text}</a>)endend
This wouldn't have been necessary with the latest version (8.5.0) which supports the :html_anchor parameter to pass some additional arguments for this specific use.
However, just updating the gem doesn't work - the styling gets lost. So this is not quite as trivial as it seems on the surface.
The text was updated successfully, but these errors were encountered:
Nothing is technically "broken" because of this, but for example, to add support for multiple pagy's on one html page (e.g. for several lists of things on different tabs), I ended up having to do a dirty and override the
pagy_link_proc
method in myapplication_helper
:This wouldn't have been necessary with the latest version (8.5.0) which supports the
:html_anchor
parameter to pass some additional arguments for this specific use.However, just updating the gem doesn't work - the styling gets lost. So this is not quite as trivial as it seems on the surface.
The text was updated successfully, but these errors were encountered: