Closed zameo94 closed 2 weeks ago
Exactly the same issue for me, rendering any partial gives a stack level to deep
when I upgraded to Rails 7.1.3.4 from Rails 7.0.5
@gettinDrikkieWithIt only partials with form_builder as locals? the others work for me
Try using form_with as form_for and form_tag are soft-deprecated.
@ccasabona I tried with form_with, same problem
@zameo94 my partial has basic text inside it, not even a form. And still getting this error
@gettinDrikkieWithIt how do you render your partial? can you share the line?
i get the same, it can be boiled down to almost nothing to replicate
= simple_form_for @plane do |form|
= render 'form_general', locals: { f: form }
and just leave whatever partial empty, in this case _form_general
@nicho1991 in my case, when I delete all the references to the form in the partial, it's working
I just found the cause for this!
i had gem 'meta_request'
in my Gemfile, this caused the error, after i removed it, i have no issue
https://github.com/dejan/rails_panel/issues/180
Thanks for investigating.
I tried to create a repro script, but the test passes. If you are able to alter the script to fail (only using rails) please feel free. It will help us bisect the offending commit, and determine how to fix.
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "rails"
# If you want to test against edge Rails replace the previous line with this:
# gem "rails", github: "rails/rails", branch: "main"
end
require "minitest/autorun"
require "action_view"
class BugTest < ActionView::TestCase
def setup
@controller.append_view_path "."
end
def test_stuff
partial = <<~ERB
<%= puts f %>
ERB
File.write("_partial.html.erb", partial)
render inline: <<~ERB
<%= form_with model: false, url: false do |f| %>
<%= render(partial: 'partial', locals: { f: f }) %>
<% end %>
ERB
end
end
@nicho1991 thanks for your message. Actually, after removing the gem meta_request
, the error disappear 🥳
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails team are limited, and so we are asking for your help.
If you can still reproduce this error on the 7-2-stable
branch or on main
, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions.
Steps to reproduce
When I try to pass the form_builder to a partial as local, I've got an infinite loop with this error:
The code is:
I noticed this problem after updating to Rails 7.1.3.4 (was 7.0.8.4)
System configuration
Rails version: 7.1.3.4
Ruby version: 3.3.2