From 268d0d8d4fc210fd50e989c35e6122b37dbd0f41 Mon Sep 17 00:00:00 2001 From: Matt Rohrer Date: Wed, 14 Dec 2022 11:40:58 +0100 Subject: [PATCH] Fix ArgumentError when using rails i18n `t` helper Before this fix calls in presenters to `t()` that included interpolation variables would fail with the exception below on ruby 3.1.3p185 ``` ActionView::Template::Error: wrong number of arguments (given 2, expected 1) ``` --- lib/curly/presenter.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/curly/presenter.rb b/lib/curly/presenter.rb index e5487b7..9bb4a01 100644 --- a/lib/curly/presenter.rb +++ b/lib/curly/presenter.rb @@ -342,8 +342,8 @@ def exposes_helper(*methods) # Delegates private method calls to the current view context. # # The view context, an instance of ActionView::Base, is set by Rails. - def method_missing(method, *args, &block) - @_context.public_send(method, *args, &block) + def method_missing(method, *args, **kwargs, &block) + @_context.public_send(method, *args, **kwargs, &block) end # Tells ruby (and developers) what methods we can accept.