Skip to content

Instantly share code, notes, and snippets.

@anujmiddha
Last active January 12, 2019 16:51
Show Gist options
  • Save anujmiddha/2742ddf54e6d55dfaf4f22b731e2f5ed to your computer and use it in GitHub Desktop.
Save anujmiddha/2742ddf54e6d55dfaf4f22b731e2f5ed to your computer and use it in GitHub Desktop.
will_paginate custom LinkRenderer with Semantic UI
module ApplicationHelper
# change the default link renderer for will_paginate
def will_paginate(collection_or_options = nil, options = {})
if collection_or_options.is_a? Hash
options, collection_or_options = collection_or_options, nil
end
unless options[:renderer]
options = options.merge :renderer => SemanticUiLinkRenderer
end
super *[collection_or_options, options].compact
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment