From 06d7ecd44692cb8c89efc6a2228fa644e363d147 Mon Sep 17 00:00:00 2001 From: domchristie Date: Fri, 21 May 2021 11:37:26 -0700 Subject: [PATCH] Customisation with options. --- lib/nice_partials/partial.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/nice_partials/partial.rb b/lib/nice_partials/partial.rb index 0f7a38c..27f0225 100644 --- a/lib/nice_partials/partial.rb +++ b/lib/nice_partials/partial.rb @@ -1,9 +1,11 @@ module NicePartials class Partial + attr_reader :options delegate_missing_to :@view_context - def initialize(view_context) + def initialize(view_context, options = {}) @view_context = view_context + @options = options @key = SecureRandom.uuid end