diff --git a/lib/inertia_rails/renderer.rb b/lib/inertia_rails/renderer.rb index f82fd23..b6f2b48 100644 --- a/lib/inertia_rails/renderer.rb +++ b/lib/inertia_rails/renderer.rb @@ -75,7 +75,8 @@ def computed_props deep_transform_values( _props, lambda do |prop| - prop.respond_to?(:call) ? controller.instance_exec(&prop) : prop + result = prop.respond_to?(:call) ? @controller.instance_exec(&prop) : prop + result.respond_to?(:to_hash) ? result.to_hash : result end ) end