Permalink
Browse files

added lightbox group support to 'lightbox_link_to' helper

  • Loading branch information...
1 parent c4c065c commit 1899803be1609381a08bc558ad752fe9b1d5ee1b @MadsBuus MadsBuus committed with Jan 30, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/lightbox_view_helper.rb
@@ -17,8 +17,9 @@ def lightbox_image_tag(source, destination, image_options = {}, html_options = {
link_to(image_tag(source, image_options), destination, html_options)
end
- def lightbox_link_to(name, options = {}, html_options = {}, *parameters_for_method_reference)
- html_options.merge!(:rel => "lightbox") unless html_options[:rel]
+ def lightbox_link_to(name, options = {}, html_options = {}, *parameters_for_method_reference)
+ group = html_options[:group]
+ html_options.merge!(:rel => (group)? "lightbox[#{group}]" : "lightbox") unless html_options[:rel]
html_options.merge!(:title => "") unless html_options[:title]
link_to(name, options, html_options, *parameters_for_method_reference)
end

0 comments on commit 1899803

Please sign in to comment.