lib/pagy/extras/shared.rb in pagy-5.0.1 vs lib/pagy/extras/shared.rb in pagy-5.1.0
- old
+ new
@@ -28,17 +28,17 @@
end
# Additions for the Frontend
module Frontend
if defined?(Oj)
- # it returns a script tag with the JSON-serialized args generated with the faster oj gem
+ # Return a script tag with the JSON-serialized args generated with the faster oj gem
def pagy_json_attr(pagy, *args)
args << pagy.vars[:page_param] if pagy.vars[:trim_extra]
%(data-pagy-json="#{Oj.dump(args, mode: :strict).gsub('"', '"')}")
end
else
require 'json'
- # it returns a script tag with the JSON-serialized args generated with the slower to_json
+ # Return a script tag with the JSON-serialized args generated with the slower to_json
def pagy_json_attr(pagy, *args)
args << pagy.vars[:page_param] if pagy.vars[:trim_extra]
%(data-pagy-json="#{args.to_json.gsub('"', '"')}")
end
end