From f1715809e81578e3ea5cce705635bb194f02d8cc Mon Sep 17 00:00:00 2001 From: Lars Henrik Mai Date: Tue, 8 Apr 2014 19:34:02 +0200 Subject: allow image helper to set class on its container div --- helpers/extra_image_helpers.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helpers/extra_image_helpers.rb b/helpers/extra_image_helpers.rb index 6a36415..8a1040d 100644 --- a/helpers/extra_image_helpers.rb +++ b/helpers/extra_image_helpers.rb @@ -20,6 +20,7 @@ module ExtraImageHelpers caption = options.delete(:caption) thumb_name = options.delete(:thumbnail) thumb_path = "/img/#{thumb_name}" + container_opts = options.delete(:container_opts) || {} image_link = content_tag(:a, href: path) do image_tag(thumb_path, options) @@ -27,7 +28,7 @@ module ExtraImageHelpers caption_tag = content_tag :p, caption - content_tag(:div) do + content_tag(:div, container_opts) do image_link << caption_tag end end -- cgit v1.2.1