Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add extra_attributes option that adds extra attributes to links. #228

Closed
wants to merge 1 commit into from

5 participants

@bryanlarsen

This is a generalization of of issue #133 / issue #100, which adds the data-remote attribute. Not all ajax frameworks work the same was as rails ujs.

@bryanlarsen bryanlarsen add extra_attributes option that adds extra attributes to links.
This is a generalization of of issue #133.  Not all ajax frameworks
work the same was as rails ujs.
f36aaa4
@acesuares

Was this ever merged?

@iox

@mislav, could you review this too? Thank you very much!

@mislav
Owner

:extra_attributes isn't descriptive enough. Extra attributes for what?

I realize that will_paginate output isn't easily customized, but throwing more options to the method doesn't make it any better; it just makes the plugin more complex, more difficult to use, and harder to maintain in the long run.

To customize output right now: as always, please subclass the LinkRenderer.

@mislav mislav closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 2, 2012
  1. @bryanlarsen

    add extra_attributes option that adds extra attributes to links.

    bryanlarsen authored
    This is a generalization of of issue #133.  Not all ajax frameworks
    work the same was as rails ujs.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/will_paginate/view_helpers/link_renderer.rb
View
1  lib/will_paginate/view_helpers/link_renderer.rb
@@ -93,6 +93,7 @@ def link(text, target, attributes = {})
target = url(target)
end
attributes[:href] = target
+ attributes = @options[:extra_attributes].merge(attributes) if @options[:extra_attributes]
tag(:a, text, attributes)
end
Something went wrong with that request. Please try again.